午夜剧场伦理_日本一道高清_国产又黄又硬_91黄色网战_女同久久另类69精品国产_妹妹的朋友在线

您的位置:首頁技術(shù)文章
文章詳情頁

Android如何實(shí)現(xiàn)底部菜單固定到底部

瀏覽:117日期:2022-09-22 14:31:36

今天搞了很久的一個(gè)問題,導(dǎo)航菜單沒有固定到底部,因?yàn)樯厦媸荓istView,可是沒內(nèi)容,于是就浮動上去了。

效果如下:

Android如何實(shí)現(xiàn)底部菜單固定到底部

這里采用的是一個(gè)碎片,代碼是:

<LinearLayoutxmlns:android='http://schemas.android.com/apk/res/android'android:layout_width='match_parent'android:layout_height='wrap_content'android:orientation='vertical' ><TextView android: android:layout_width='match_parent' android:layout_height='wrap_content' android:background='@drawable/background_card' android:gravity='center' android:textSize='18sp'/><ListView android: android:layout_width='match_parent' android:layout_height='match_parent' android:layout_marginBottom='48dp' /></LinearLayout>

出問題了,百度了很多,試了很多的辦法,沒用。

主頁面代碼:

<?xml version='1.0' encoding='utf-8'?><android.support.constraint.ConstraintLayout xmlns:android='http://schemas.android.com/apk/res/android' xmlns:app='http://schemas.android.com/apk/res-auto' xmlns:tl='http://schemas.android.com/apk/res-auto' xmlns:tools='http://schemas.android.com/tools' android: android:layout_width='match_parent' android:layout_height='wrap_content' android:background='#eeeeee' android:scrollbars='none' > <LinearLayout android:layout_width='match_parent' android:layout_height='match_parent' android:orientation='vertical'> <!--android:background='@color/colorPrimaryDark'--> <!--內(nèi)容--> <FrameLayout android: android:layout_weight='1' android:layout_width='match_parent' android:layout_height='match_parent' app:layout_constraintLeft_toLeftOf='parent' app:layout_constraintRight_toRightOf='parent' > </FrameLayout> <!-- <LinearLayout xmlns:android='http://schemas.android.com/apk/res/android' android:layout_width='fill_parent' android:layout_height='wrap_content' android: android:layout_alignParentBottom='true' >--><!--底部--> <com.flyco.tablayout.CommonTabLayout android: android:layout_width='match_parent' android:layout_height='wrap_content' android:background='#ffffff' app:layout_constraintBottom_toBottomOf='parent' app:layout_constraintLeft_toLeftOf='parent' app:layout_constraintRight_toRightOf='parent' tl:tl_indicator_gravity='TOP' tl:tl_indicator_color='#2C97DE' tl:tl_textSelectColor='#2C97DE' tl:tl_textUnselectColor='#66000000' tl:tl_underline_height='2dp'/> <!-- </LinearLayout>--> <!--android:layout_alignParentBottom='true'--> </LinearLayout></android.support.constraint.ConstraintLayout >

最后發(fā)現(xiàn)是這段代碼惹的麻煩:android:layout_height='wrap_content'

也是自己對這個(gè)屬性沒有了解清楚,不知道從哪里copy來的一個(gè)代碼,這個(gè)屬性代碼自動浮動,根據(jù)內(nèi)容更改大小。所以就造成了我現(xiàn)在的情況。

所以改成:android:layout_height='match_parent' 就好了。

Android如何實(shí)現(xiàn)底部菜單固定到底部

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

標(biāo)簽: Android
相關(guān)文章:
主站蜘蛛池模板: 欧美视频一二区 | 婷婷色站| 国产精品美女久久久久久久久 | 亚洲视频欧美 | 欧美一级爱爱 | xvideos永久免费入口 | 精品日韩一区 | 中文字幕在线观看视频免费 | 日韩高清一级 | 国产精品视频99 | 日日麻批免费视频播放 | 少妇久久久久久久 | 精品国产乱码久久久 | 4虎最新网址 | 国产视频在线一区二区 | 国产精品久久久久久一区二区三区 | 麻豆视频免费在线播放 | 日本a级片在线观看 | 亚洲三级在线视频 | www国产在线观看 | 日本韩国欧美一区 | 区一区二视频 | 午夜视频免费 | 自拍网址| 欧美一级淫片免费视频魅影视频 | 国产亚洲精品久久久久动 | 在线视频久 | 岛国精品在线观看 | 永久av免费网站 | 亚洲成人天堂 | 色噜噜日韩精品欧美一区二区 | 美日韩视频 | 一本久草 | 99视频免费| 欧美一级免费片 | 国产免费一区二区三区免费视频 | 色婷婷激情 | 天天舔天天操 | 中文字幕 视频一区 | 黄色大片久久 | 国产黄色成人 |