【发布时间】:2012-05-04 22:27:07
【问题描述】:
我在 xml 中有以下内容。它用于相对布局:
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv1"/>
<TextView
android:id="@+id/tv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv2" />
在代码中,如果我删除第二个 textview (tv2),我想将 tv3 重新定位到 tv1 下方。我无法找到使用 xml 执行此操作的方法,因此我想以编程方式执行此操作。我怎样才能做到这一点?非常感谢!
【问题讨论】:
标签: android