久久福利_99r_国产日韩在线视频_直接看av的网站_中文欧美日韩_久久一

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

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

瀏覽:34日期: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
相關文章:
主站蜘蛛池模板: 久久久精品综合 | 亚洲二区在线观看 | 久久人人爽爽爽人久久久 | 久久久蜜臀 | 精品国产欧美一区二区三区成人 | 国产精品18hdxxxⅹ在线 | 日韩高清一区 | 在线看av的网址 | 一区二区在线免费观看 | 亚洲 欧美 另类 综合 偷拍 | 中文字幕乱码一区二区三区 | 91文字幕巨乱亚洲香蕉 | 精品亚洲成a人在线观看 | 色天天天天色 | 国产成人精品一区二区三区四区 | 欧美色欧美亚洲另类七区 | 日韩在线观看毛片 | 精品视频一区二区 | 亚洲a网 | 黑人精品xxx一区一二区 | 可以免费观看的av片 | 精品国产乱码一区二区三区 | www.一区| 在线看91| 九九在线精品 | 中文字幕亚洲欧美 | 91精品视频在线播放 | 91免费看网站 | 亚洲电影一区二区三区 | 国产精品中文字幕在线 | 日本在线观看视频一区 | 国产久精品 | 色播开心网| 久久久久久久一区 | 在线免费观看色视频 | 一区在线视频 | 在线一区二区免费 | 精品久久久久久久久久久久 | 日韩在线观看精品 | 在线播放一区二区三区 | 在线观看免费的av |