最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

android利用xml實(shí)現(xiàn)分割線

 更新時(shí)間:2015年12月30日 15:07:52   作者:學(xué)習(xí)編程知識(shí)  
這篇文章主要介紹了android利用xml實(shí)現(xiàn)分割線的方法,如何用xml產(chǎn)生一個(gè)分割線?感興趣的小伙伴們可以參考一下

因?yàn)闆]有美工, 所以只能自己動(dòng)手了。

在layout文件夾里的xml 寫

方法1:在layout里面的布局xml 文件里加上面的代碼

 <View
 android:layout_width="match_parent"
 android:layout_height="1dp"
 android:background="@color/orange_normal" />

效果圖

在drawable文件夾里用 shape line 或 rectangle 先畫線

方法2:在drawable里面用shape新建一個(gè)xml

然后在 layout 里的布局文件里引用

這種方法 可以 多處引用同一個(gè) line 樣式

<!-- drawable/line_my.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="line" >

 <stroke android:color="@color/orange_normal" />

</shape>

或者用填充的矩形實(shí)現(xiàn)

<shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="rectangle" >

 <solid android:color="@color/orange_normal" />

 <size
  android:height="1dp"
  android:width="100dp" />

</shape>

Note
android:width=”100dp” 不能賦值為 “match_parent”
在layout/bomb_fragment.xml 里面引用

 <TextView
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:background="@drawable/line_my" />

希望本文所述對(duì)大家學(xué)習(xí)Android軟件編程有所幫助。

相關(guān)文章

最新評(píng)論

松溪县| 曲阜市| 辛集市| 淮南市| 乌拉特中旗| 股票| 石家庄市| 吉林省| 北票市| 沛县| 吉隆县| 十堰市| 四川省| 尚义县| 玛多县| 遂平县| 武安市| 安塞县| 茌平县| 武隆县| 高阳县| 拜泉县| 宁阳县| 焦作市| 北流市| 阿克苏市| 磴口县| 峨边| 自治县| 剑河县| 小金县| 福建省| 扎赉特旗| 四会市| 恭城| 德兴市| 黄大仙区| 花垣县| 乌鲁木齐县| 黄冈市| 林芝县|