国产探花免费观看_亚洲丰满少妇自慰呻吟_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開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 荣昌县| 阿拉善盟| 伊川县| 黄梅县| 寿宁县| 临澧县| 苗栗县| 武强县| 上高县| 全州县| 东丰县| 江孜县| 太原市| 安庆市| 灵山县| 南江县| 鲁甸县| 西乡县| 宁津县| 广德县| 肇东市| 临沂市| 泰顺县| 山东| 淮安市| 大港区| 仁寿县| 东海县| 赣州市| 攀枝花市| 常州市| 汉阴县| 米林县| 乳源| 塔河县| 石河子市| 静乐县| 志丹县| 固镇县| 固镇县| 从化市|