亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

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

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

瀏覽:17日期: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
相關文章:
主站蜘蛛池模板: 久久久久琪琪免费影院 | 精品国产高清a毛片 | 一级a俄罗斯毛片免费 | 男女爱爱免费 | 亚洲黄网在线播放高清 | 久久成人精品 | 亚洲人成网站999久久久综合 | 日本一区欧美 | 国产精品αv在线观看 | 俺也来国产精品欧美在线观看 | a级在线看 | 色亚洲色图 | 欧美一级毛片免费看高清 | 三级毛片三级毛片 | 日韩毛片免费 | 劲爆激情欧美毛片 | 高清一级做a爱视频免费 | 欧美人一级淫片a免费播放 欧美人七十二式性视频教程一 | 99免费精品 | 国产三级在线观看视频不卡 | 欧美一区永久视频免费观看 | 国产成人精品视频播放 | 在线观看亚洲精品专区 | 特级黄国产片一级视频播放 | 亚洲精品久久成人福利 | 国产免费又色又爽又黄在线观看 | 成年性羞羞视频免费观看无限 | 青草资源视频在线高清观看 | 亚洲一区二区三区国产精品 | 在线观看免费网址大全 | 欧美色图亚洲综合 | 国产伦一区二区三区四区久久 | 一级毛片免费观看久 | 特黄视频 | 亚洲不卡视频在线观看 | 黄色地址 | 成人免费视频一区 | 91madou麻豆| 免费国产成人午夜在线观看 | 成人黄页网站免费观看大全 | 久久精品影院一区二区三区 |