国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

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

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

瀏覽:10日期: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
相關文章:
主站蜘蛛池模板: 国产一区二区精品久 | 国产精品久久九九 | 高清国产一区二区三区 | 亚洲三级黄色 | 日本一区二区三区四区五区 | 一男一女的一级毛片 | 成年人免费黄色片 | 成人网在线视频 | 九九久久久久久久爱 | 午夜性刺激免费视频观看不卡专区 | 国产美女视频做爰 | 久久爱一区 | 国产成人夜间影院在线观看 | 日韩 国产 欧美 精品 在线 | 久久精品国产欧美 | 欧美韩国日本 | 国产区精品一区二区不卡中文 | www.亚洲视频 | 日韩三级在线 | 久久99中文字幕 | 亚洲aⅴ男人的天堂在线观看 | 特级片在线观看 | dy888午夜国产午夜精品 | 国产精品欧美日韩一区二区 | 欧美亚洲视频一区 | 日韩欧美中文字幕在线观看 | 欧美一区二区在线 | 高h原耽肉汁动漫视频 | 欧美成人精品三级网站 | 欧美一级毛片片aa视频 | 在线日韩视频 | 激情丝袜美女视频二区 | 国产欧美日韩不卡一区二区三区 | 免费精品久久 | 男人天堂日韩 | 国产高清免费视频 | 国产成人无精品久久久久国语 | 成年片免费网址网站 | 精品一区二区三区五区六区 | 美女曰皮 | 草草影院ccyy免费看片 |