FrameLayout中控件使用属性:layout_weight

来源:互联网 发布:painter安装教程mac 编辑:程序博客网 时间:2024/06/08 03:09
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent">          <Button          android:id="@+id/button"         android:layout_width="0dp"         android:layout_height="wrap_content"         <span style="color:#ff0000;">android:layout_weight="1"</span> <span style="color:#ff0000;">//无论是否添加此句,显示效果一样:就是不显示</span>         android:text="Button"/></FrameLayout>

 

结论:

FrameLayout中view是层叠方式,没有所谓的剩余空间,所以layout_weight就失去了基准,也就失效了。

0 0
原创粉丝点击