[英]is there a consistent behavior when we set visibility gone on relative layout when another view is set above the gone view?
I have a relative layout with two views: 我有两个视图的相对布局:
<RelativeLayout ...>
<view
android:id:""+@id/view1"
android:layout_above:"+@id/view2" />
<view
android:id:""+@id/view2"
android:layout_alignParentBottom="true" />
</RelativeLayout>
Is there consistent behavior when I set view2 Visibility to gone? 将view2的可见性设置为“消失”时,行为是否一致?
If I undestand you correctly you can do this in 3 ways: 如果我对您的理解不正确,可以通过以下三种方式进行:
linearlayout
because it will always be above view2 even if its GONE ; 在这种情况下,您应该使用linearlayout
因为它总是在view2之上,即使它已经消失了 ; Let me know if I can help you. 让我知道我是否可以帮助您。
Edit: 编辑:
when you put the view to GONE is like it doesn't exist so, view1 will be placed just like this line doesn't exists: android:layout_above:"+@id/view2" 当您将视图放置到GONE上时,就像它不存在一样,将放置view1就像该行不存在一样:android:layout_above:“ + @ id / view2”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.