![](/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.