/ /画面下部のタブホストをクラスレイアウトの下に隠す-Android

画面の下部にタブのホストを設定してクラスレイアウトの下に隠す - android

こんにちはfrndsの下部にタブホストを設定したい以下のxmlを使用して画面を表示し、コードに実装すると、クラスxmlの下に非表示になるので、この状況からの移行方法を以下に示します。

   <?xml version="1.0" encoding="utf-8"?>
<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp" />
</RelativeLayout>
</TabHost>

回答:

回答№1は0
   <?xml version="1.0" encoding="utf-8"?>
<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">


<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp" />
<TabWidget
android:id="@android:id/tabs"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</TabHost>

これを試してみて、タブウィジェットを下部に配置し、relativeLayoutも削除しました。


回答№2については2
<?xml version="1.0" encoding="utf-8"?>

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:paddingBottom="60dp">
<LinearLayout android:id="@+id/calltabs_content"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">

</LinearLayout>
</FrameLayout>
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget android:id="@android:id/tabs"
android:layout_alignParentBottom="true" android:layout_width="fill_parent"
android:layout_height="63dp" android:background="@drawable/background" />
</RelativeLayout>
</TabHost>

これを試してみてください。