首页 > 其他 > 详细

如何实现底部工具栏的位置在屏幕底部

时间:2014-06-24 16:56:45      阅读:436      评论:0      收藏:0      [点我收藏+]

一个垂直方向的LinearLayout,包含两个View。下面一个View(工具栏)固定在屏幕底部,上面的View占据剩余的屏幕空间。

    <LinearLayout
        android:orientation="vertical"
        android:id="@+id/vertical_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <FrameLayout android:id="@+id/main_content"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
         />
        
        <FrameLayout android:id="@+id/fixed_bottombar_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
        />
    </LinearLayout>


android:layout_height="0dp" <!-- 这里不能设置fill_parent -->
android:layout_weight="1" <!-- 这里设置layout_weight=1是最关键的,否则底部的LinearLayout无法到底部 -->

如何实现底部工具栏的位置在屏幕底部,布布扣,bubuko.com

如何实现底部工具栏的位置在屏幕底部

原文:http://sunhongbo.blog.51cto.com/4382014/1429870

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!