第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

安卓簡(jiǎn)單布局樣例_采用LinearLayout實(shí)現(xiàn)多列多行展示

標(biāo)簽:
Android

实现效果:

webp

代码:

  1. 布局文件:

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="#F3F3F3"
              android:orientation="vertical">
    <LinearLayout
            android:id="@+id/ll_top_split"
            android:layout_width="match_parent"
            android:layout_height="17dp"
            android:layout_marginTop="10dp"
            android:background="#FFFFFF"
            android:orientation="horizontal"/>

    <LinearLayout style="@style/row_style">

        <LinearLayout
                android:id="@+id/ll_test1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="0.33"
                android:orientation="vertical">

            <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="@mipmap/ic_launcher"/>

            <TextView
                    style="@style/item_text_style"
                    android:text="测试1"/>
        </LinearLayout>

        <LinearLayout
                android:id="@+id/ll_test2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="0.33"
                android:orientation="vertical">

            <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="@mipmap/ic_launcher"/>

            <TextView
                    style="@style/item_text_style"
                    android:text="测试2"/>
        </LinearLayout>

        <LinearLayout
                android:id="@+id/ll_test3"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="0.33"
                android:orientation="vertical">

            <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="@mipmap/ic_launcher"/>

            <TextView
                    style="@style/item_text_style"
                    android:text="测试3"/>
        </LinearLayout>

    </LinearLayout>
    <LinearLayout style="@style/row_style">

        <LinearLayout
                android:id="@+id/ll_test4"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="0.33"
                android:orientation="vertical">

            <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="@mipmap/ic_launcher"/>

            <TextView
                    style="@style/item_text_style"
                    android:text="测试4"/>
        </LinearLayout>

        <LinearLayout
                android:id="@+id/ll_test5"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="0.33"
                android:orientation="vertical">

            <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="@mipmap/ic_launcher"/>

            <TextView
                    style="@style/item_text_style"
                    android:text="测试5"/>
        </LinearLayout>

        <!-- 下面是一个空的布局,用于占位,便于控件各占三分之一屏幕-->
        <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="0.33"
                android:orientation="vertical"/>

    </LinearLayout>

    <LinearLayout
            android:id="@+id/ll_bottom_split"
            android:layout_width="match_parent"
            android:layout_height="15dp"
            android:background="#FFFFFF"
            android:orientation="horizontal"/></LinearLayout>
  1. styles.xml

<style name="item_text_style">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_gravity">center</item>
        <item name="android:layout_marginTop">11dp</item>
        <item name="android:background">#FFFFFF</item>
        <item name="android:gravity">center</item>
        <item name="android:textSize">13sp</item>
        <item name="android:textColor">#333333</item>
    </style>

    <style name="row_style">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:background">#FFFFFF</item>
        <item name="android:paddingTop">11dp</item>
        <item name="android:paddingBottom">11dp</item>
    </style>



作者:程序园中猿
链接:https://www.jianshu.com/p/2d39c4b5832d


點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺(jué)得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評(píng)論
  • 收藏
  • 共同學(xué)習(xí),寫(xiě)下你的評(píng)論
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說(shuō)多少就多少
贊賞金額會(huì)直接到老師賬戶(hù)
支付方式
打開(kāi)微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專(zhuān)欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消