屏幕適配1(Android 加強版百分比佈局庫 爲了適配而擴展)

轉載請標明出處: 
http://blog.csdn.net/lmj623565791/article/details/46767825; 
本文出自:【張鴻洋的博客】android

這篇博文寫得太好了,讓我很激動,分享分享!git

詳細請前往出處 http://blog.csdn.net/lmj623565791/article/details/46767825 進行學習github

我這裏給出我導入時的步驟和使用方法吧!app

導入步驟:學習

一、https://github.com/hongyangAndroid/android-percent-support-extend 下載,解壓.net

 

二、在 android stdio 中導入Modelxml

 

 

三、編譯,若是出錯,就根據出錯的提示,把出錯的信息屏蔽掉blog

四、使用utf-8

<?xml version="1.0" encoding="utf-8"?>
<com.zhy.android.percent.support.PercentLinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
      >
    <TextView
        android:width="0dp"
        android:height="0dp"
        app:layout_heightPercent="20%"
        app:layout_widthPercent="30%"
        android:text="很好"
        android:background="@android:color/holo_blue_light"
        />
    <TextView
        android:width="0dp"
        android:height="0dp"
        app:layout_heightPercent="80%"
        app:layout_widthPercent="70%"
        android:text="你好啊"
        android:background="@android:color/holo_red_light"
        />
</com.zhy.android.percent.support.PercentLinearLayout>get

相關文章
相關標籤/搜索