色综合图-色综合图片-色综合图片二区150p-色综合图区-玖玖国产精品视频-玖玖香蕉视频

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

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

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

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

效果如下:

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'

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

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

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

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

標(biāo)簽: Android
相關(guān)文章:
主站蜘蛛池模板: 亚洲视色 | 狠狠综合久久久久综合小说网 | 日本特黄乱人伦片 | 欧美毛片 | 国产精品成人亚洲 | xxxxx日本59| 欧美野外性k8播放性迷宫 | 欧美日本高清 | 国产成人精品综合在线 | 99精品免费在线观看 | 国产综合精品久久亚洲 | 亚洲码一区二区三区 | 高清国产露脸捆绑01经典 | 成人三级在线视频 | 亚洲视频一区在线观看 | 大学生久久香蕉国产线观看 | 98国内自拍在线视频 | 最新国产一区二区精品久久 | 色香欲综合成人免费视频 | 欧美成人精品 | 在线亚洲播放 | 国产午夜毛片v一区二区三区 | 亚洲精品69| 欧美成人手机视频免费播放 | 三级黄色片在线免费观看 | 三级精品 | 色欲麻豆国产福利精品 | 久久99久久99精品观看 | 欧美视频精品一区二区三区 | 免费人成在线观看网站 | 成人欧美在线视频 | 久久久久国产精品 | 欧美一区二区三区免费 | 国产无套视频在线观看香蕉 | 在线成人免费视频 | 国产农村一二三区 | 国产美女一区精品福利视频 | 在线观看国产情趣免费视频 | 91成人在线免费视频 | 久久精品视频在线播放 | 欧美久久久久久久一区二区三区 |