<LinearLayout xmlns:android="
http://schemas.android.com/apk/res/android"
xmlns:tools="
http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context="com.databar.MainActivity" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="8"
android:id="@+id/llayout"
android:orientation="horizontal"
android:background="@drawable/rectangle" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:id="@+id/llayout1"
android:background="@drawable/rectangle_1" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<TextView
android:id="@+id/lat"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="right|center"
android:text="위도" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<TextView
android:id="@+id/lng"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="right|center"
android:text="경도" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:id="@+id/llayout2"
android:background="@drawable/rectangle_1" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/rectangle_1" >
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="left|center"
android:layout_weight="1"
android:text=" SOG" />
<TextView
android:id="@+id/sog"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="right|center" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="left|center"
android:text=" COG" />
<TextView
android:id="@+id/cog"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="right|center" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:id="@+id/llayout3"
android:background="@drawable/rectangle_1" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/rectangle_1" >
<TextView
android:id="@+id/track"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="left|center"
android:text="TRACK" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
>
<TextView
android:id="@+id/wpt"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="left|center"
android:text="WPT" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:id="@+id/llayout4" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/rectangle_1" >
<TextView
android:id="@+id/Date"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="left|center"
android:text="날짜"
android:textSize="13sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<TextView
android:id="@+id/suName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="left|center"
android:layout_weight="1"
android:text="수신도" />
<TextView
android:id="@+id/su"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="right|center"
android:layout_weight="1"
android:text="수신도" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
여기서 메뉴 버튼을 이용해서 리니어레이아웃을 두칸 아니면 세칸 으로 자바코드로 구현할려고해요 그런데
여기서 계속 막히더라구요
llLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,8));
llLayout1.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1));
llLayout2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1));
llLayout3.removeAllViews();
llLayout4.removeAllViews();
이렇게 구현하는게 아닌가요..? 이렇게하면 3번이랑 4번만 안에 내용만 없어져요
저는 아예레이아웃 통째로 없애버리고 싶은데 부탁드립니다