我有三个 subLinearlayout RelativeLayout
。我以编程方式隐藏和显示所有三种布局RelativeLayout
。
在以上所有三个 subLinearlayout 中,第一个Linearlayout
内容比其他两个大。因此,当我显示第二个时LinearLayout
,它也会占据第一个的空间LinearLayout
。
我想在显示第二个 LinearLayout 时删除 FirstLinear Layout 的占用空间。
为了更好地理解,我在下面粘贴了我的 xml 布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white" >
<!-- ATC/TCAS/AIRSPACE -->
<LinearLayout
android:id="@+id/atcTypeLinear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal"
android:visibility="gone" >
<include
android:id="@+id/atcType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/atc_incident_type" />
</LinearLayout>
<!-- Evacuation -->
<LinearLayout
android:id="@+id/mainEvoccutionLinear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal"
android:visibility="gone" >
<LinearLayout
android:id="@+id/evocutionLinear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Emergencies /Evacuation"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@android:color/black"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@drawable/editable"
android:text="Details "
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@android:color/black"
android:textStyle="bold" />
<!-- Dyanmic check Box -->
</LinearLayout>
<LinearLayout
android:id="@+id/secEvoLinear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="100dp"
android:layout_marginTop="25dp"
android:orientation="vertical" >
<!-- Dyanmic check Box -->
</LinearLayout>
</LinearLayout>
<!-- Evolution layout over and start of collision near miss -->
<LinearLayout
android:id="@+id/collisionNearLinear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="vertical"
android:visibility="gone" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@drawable/editable"
android:text="Collision/Near Miss "
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@android:color/black"
android:textStyle="bold" />
<!-- dynamic creation of check box -->
</LinearLayout>
</RelativeLayout>
请大家帮帮我..