![](/img/trans.png)
[英]Adding Rule programatically to a View that is already in the layout - Android
[英]Android: How to cover the whole layout by a view programatically while the layout contains buttons already?
首先将根布局切换为RelativeLayout,类似
<RelativeLayout ...>
<View android:id="@+id/view1"
... />
<View android:id="@+id/view2"
...
android:layout_below="@id/view1" />
<View android:id="@+id/view3"
...
android:layout_toRightOf="@id/view2"
android:layout_below="@id/view1" />
...
然后在该布局的底部添加忽略所有其他视图的叠加层(因此可以绘制它们)
<View android:id="@+id/overlay"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.