Issue with RelativeLayout when View visibility is View.GONE

后端 未结 8 982
自闭症患者
自闭症患者 2021-02-02 05:11

I\'ve a RelativeLayout thus:



 // <-- View.VISIBLE OR View.GONE

<         


        
8条回答
  •  孤城傲影
    2021-02-02 05:28

    This answer does not solve your specific problem, but does solve a similar one, so hopefully this will help somebody.

    I had a situation where my relative layout did not have the equivalent of your TextView1. So, in my situation, if TextView2 was GONE, then I wanted TextView3 to be aligned with the parent's top. I solved that by adding to TextView3 the attribute android:layout_alignWithParentIfMissing="true". See http://developer.android.com/resources/articles/layout-tricks-efficiency.html.

    Unfortunately, I do not see a way to specify an alternate alignment anchor unless it is the parent.

提交回复
热议问题