国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Android > 正文

Android使用LinearLayout設置邊框

2019-12-12 02:01:02
字體:
來源:轉載
供稿:網友

找到好多人的,都是文章隨便copy,自己都不驗證下,特別說LinearLayout中可以設置他的divider屬性的,我在Android Studio中試了,根本顯示不出來,這邊是csdn上一個朋友回答的,我收藏了,放到這里,后面備用。

1.定一個underline的xml文件,把它放到drawable下

underline.xml

<?xml version="1.0" encoding="UTF-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android" >  <!-- 連框顏色值 -->  <item>    <shape>      <solid android:color="#dddddd" />    </shape>  </item>  <!-- 主體背景顏色值 -->  <item android:bottom="1dp"> <!--設置只有底部有邊框-->    <shape>      <solid android:color="#ffffff" />    </shape>  </item></layer-list>

2.然后在LinearLayout中引用該布局。就會出現下邊框

  <LinearLayout    android:orientation="horizontal"    android:layout_width="match_parent"    android:layout_marginRight="5dp"    android:layout_marginLeft="5dp"    android:paddingBottom="5dp"    android:paddingTop="5dp"    android:paddingRight="5dp"    android:background="@drawable/linearlayout_underline"    android:layout_height="wrap_content">    <TextView      android:text="余額:5611.19元"      android:layout_width="wrap_content"      android:layout_height="wrap_content"      android:textColor="@color/red_font"      android:textSize="18dp"      android:id="@+id/member_balance"      android:layout_weight="1"      android:textAlignment="textEnd"/>  </LinearLayout>

3.實現的效果圖如下:

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持武林網。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 芜湖县| 澳门| 扎赉特旗| 黄平县| 阳曲县| 湟中县| 辽宁省| 凤翔县| 长治市| 乐山市| 云龙县| 伊通| 淮阳县| 凭祥市| 宜丰县| 阿勒泰市| 梅州市| 外汇| 肥城市| 崇信县| 射阳县| 广州市| 泸州市| 天水市| 鄂托克前旗| 泰来县| 汤原县| 彰武县| 舒城县| 齐齐哈尔市| 庆云县| 怀安县| 皋兰县| 正镶白旗| 永平县| 巴青县| 阿拉善盟| 巴彦淖尔市| 华阴市| 阿勒泰市| 拜泉县|