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

首頁 > 系統 > Android > 正文

Android使用LinearLayout設置邊框

2019-10-22 18:27:25
字體:
來源:轉載
供稿:網友

找到好多人的,都是文章隨便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.實現的效果圖如下:

Android,LinearLayout,邊框

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


注:相關教程知識閱讀請移步到Android開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 城步| 句容市| 峨边| 潞城市| 唐海县| 永州市| 呈贡县| 庆元县| 黎川县| 都江堰市| 马鞍山市| 仁寿县| 曲松县| 阳泉市| 天津市| 潞西市| 梁河县| 济源市| 奉化市| 远安县| 阳新县| 卓尼县| 布尔津县| 麻江县| 黔东| 巴东县| 玉田县| 青阳县| 大足县| 米泉市| 双鸭山市| 龙门县| 翁源县| 库尔勒市| 阜康市| 枣阳市| 蓬安县| 吕梁市| 威远县| 罗甸县| 张掖市|