【发布时间】:2015-12-12 01:51:06
【问题描述】:
我有一个视图,其可见性设置为大部分时间(视图 A)和它下方的另一个视图始终可见(视图 b),有时视图 A 视图在某些情况下设置为可见,发生这种情况时,视图 B 将不可见(主要是因为视图 A 在出现时阻止了它)。我想知道系统是否有办法在视图 B 出现时将视图 B 重新定位到视图 A 下方。
<RelativeLayout
android:id="@+id/require_info"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/payment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="gone">
<View
android:layout_width="fill_parent"
android:layout_height="0.2dp"
android:layout_marginTop="10dp"
android:background="#c0c0c0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="@string/quantity_label"
android:textSize="10sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/contact_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/payment"
android:orientation="vertical">
<TextView
android:id="@+id/contact_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Contact Information"
android:textColor="#90CAF9"
android:textSize="15sp" />
</LinearLayout>
</RelativeLayout>
【问题讨论】:
标签: android view visibility