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

Android使用LinearLayout設(shè)置邊框

 更新時間:2021年08月18日 15:36:01   作者:百世經(jīng)綸一頁書梵天  
這篇文章主要介紹了Android如何使用LinearLayout設(shè)置邊框,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下

找到好多人的,都是文章隨便copy,自己都不驗(yàn)證下,特別說LinearLayout中可以設(shè)置他的divider屬性的,我在Android Studio中試了,根本顯示不出來,這邊是csdn上一個朋友回答的,我收藏了,放到這里,后面?zhèn)溆谩?/p>

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"> <!--設(shè)置只有底部有邊框-->
    <shape>
      <solid android:color="#ffffff" />
    </shape>
  </item>
</layer-list>

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

  <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.實(shí)現(xiàn)的效果圖如下:

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論

苏尼特左旗| 花莲市| 全南县| 安福县| 嘉黎县| 饶阳县| 雷州市| 丰都县| 长治市| 淳化县| 湖州市| 行唐县| 十堰市| 丹凤县| 安顺市| 甘德县| 鄂伦春自治旗| 岐山县| 商丘市| 神木县| 青岛市| 承德市| 逊克县| 溆浦县| 蓝田县| 和硕县| 满城县| 海淀区| 赤城县| 师宗县| 湘西| 宁城县| 运城市| 志丹县| 日照市| 石棉县| 海口市| 扶余县| 逊克县| 高陵县| 抚松县|