【发布时间】:2014-05-18 12:12:51
【问题描述】:
我想知道是否可以将不同相对布局的 2 个兄弟姐妹相互对齐。 例如,给定这个 XML:
<RelativeLayout>
..
<RelativeLayout android:id="@+id/layout1" >
..
<TextView android:id="@+id/text1 />
</RelativeLayout>
<RelativeLayout android:id="@+id/layout2" >
..
<TextView android:id="@+id/text2 />
</RelativeLayout>
</RelativeLayout>
我想将 text1 和 text2 相互对齐。可能吗?或者,还有其他方法可以实现这样的目标吗? 谢谢!!
【问题讨论】:
-
I would like to align text1 and text2 with each other. is it possible?否。alternately, is there some other way to achieve something like this?YES:将两个 TextView 对齐到父级的左侧,将它们的父级对齐到祖父级的左侧。如果两个 TextView 在同一个容器中会更好。 -
好的,谢谢。我有一种感觉,这将是一个问题,但只是想确定一下。欢迎您写下您的评论作为答案,以便我接受:)
-
好的,完成。也许它也对其他人有帮助! ;)
标签: android xml android-relativelayout