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

您的位置:首頁技術文章
文章詳情頁

Android如何實現底部菜單固定到底部

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

今天搞了很久的一個問題,導航菜單沒有固定到底部,因為上面是ListView,可是沒內容,于是就浮動上去了。

效果如下:

Android如何實現底部菜單固定到底部

這里采用的是一個碎片,代碼是:

<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'--> <!--內容--> <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 >

最后發現是這段代碼惹的麻煩:android:layout_height='wrap_content'

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

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

Android如何實現底部菜單固定到底部

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持好吧啦網。

標簽: Android
相關文章:
主站蜘蛛池模板: 黄影院 | 亚洲日韩视频免费观看 | 日本亚洲欧美在线 | 欧美成人自拍 | 狠狠色婷婷丁香综合久久韩国 | 91精品国产福利尤物免费 | 成人影视免费 | 亚洲午夜影视 | 92看片淫黄大片看国产片 | 免费精品国产 | 国产美女精品三级在线观看 | 老湿菠萝蜜在线看 | 国产高清在线不卡 | 成人毛片在线播放 | 亚洲韩精品欧美一区二区三区 | 亚欧色视频在线观看免费 | 国产中文字幕在线免费观看 | 港台三级在线观看 | 国产日韩精品一区二区在线观看 | 久久国产精品免费网站 | 精品欧美一区二区三区在线观看 | 欧美一级毛片不卡免费观看 | 男人使劲躁女人视频小v | 自拍 亚洲 欧美 | 香港三级日本三级妇人三级 | 99久久99久久精品免费看子 | 亚洲小视频在线播放 | 欧美一级片在线观看 | 91福利网 | 精品一区二区三区在线视频观看 | 黄色三级网 | 91视频一区 | 国产精品一区二区久久精品 | 精品综合久久久久久99 | 日韩黄色毛片 | 国产精品高清一区二区 | 国产中文字幕视频 | 九九99九九在线精品视频 | 国产成人a毛片 | 欧美日韩国产一区二区三区在线观看 | 亚洲va中文字幕 |