tabhost말고 fragment를 이용해서 상단에 버튼 네개를 배치하고,
버튼을눌러 각 페이지를 하단에 보여주는 식으로 구성했습니다.
메인 레이아웃 xml에서
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffffff"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="15dp"
android:layout_weight="1.99"
android:background="#ffffffff"
android:orientation="horizontal" >
<Button
android:id="@+id/btn_1"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<Button
android:id="@+id/btn_2"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<Button
android:id="@+id/btn_3"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<Button
android:id="@+id/btn_4"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="18.66"
android:background="#FFC19E"
android:orientation="vertical" />
</LinearLayout>
</RelativeLayout>
이렇게 구성해서, 상단에 버튼, 아래엔 각 페이지를 띄워줄 프래그먼트 레이아웃으로 나눴습니다.
그리고, btn_1을 눌렀을 때 아랫쪽에 해당 레이아웃이 나오긴 하는데, 윗쪽의 버튼배치영역의 높이가 작아지면서
버튼이 찌그지네요 ㅠㅠ..
아래 소스는 btn_1을 눌렀을 때 프래그먼트에 보여줄 one.xml 입니다.
비율면에서 뭔가를 잘못건드린걸까요? 메인xml에서 이미 프래그먼트로 보여줄 영역을 나눠서
윗쪽 영역[버튼배치]은 간섭을 안받을거라 생각했는데 , 위의 영역 높이가 줄어듭니다.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#dfdfdf">
<Button
android:id="@+id/tool_01"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
/>
<Button
android:id="@+id/tool_02"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#dfdfdf"/>
</LinearLayout>