おはようございます。相対レイアウトでタブホストを間違えずに配置できますか? 私はそれを働かせることができません。コードを配置すると、画像が取得したいものになります(タブホストの上のWebビューで、ボタンの下にある必要があります)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="@+id/button1"
android:layout_width="100px"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="-" />
<Button
android:id="@+id/button2"
android:layout_width="100px"
android:layout_height="wrap_content"
android:layout_above="@+id/webView1"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/button1"
android:text="+" />
<TabHost
android:id="@+id/tabHost"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_below="@+id/button1"
android:layout_centerHorizontal="true" />
<FrameLayout android:layout_width="wrap_content"
android:layout_height = "wrap_content"
android:id= "@android:id/tabcontent">
<LinearLayout
android:id="@+id/tabX1"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:id="@+id/webView1"
android:layout_width="match_parent"
android:layout_height="500px"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/tabX2"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
</LinearLayout>
</FrameLayout>
<TabWidget android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height ="wrap_content">
</TabWidget>
</TabHost>
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/button2"
android:ems="10" >
<requestFocus />
</EditText>
</RelativeLayout>
</LinearLayout>
編集
これはエラーです:
"" は必須の layout_width 属性を設定しません: (1) "wrap_content" に設定します (2) "match_parent" に設定します "" は必須の layout_height 属性を設定しません: (1) "wrap_content" に設定します (2) "に設定しますmatch_parent" "" は必要な layout_width 属性を設定しません: (1) "wrap_content" に設定します (2) "match_parent" に設定します "" は必要な layout_height 属性を設定しません: (1) "wrap_content" に設定します (2) 設定します「match_parent」TabHost には、ID「android:id/tabs」の TabWidget が必要です。
layout_width 属性を指定する必要があります。layout_height 属性を指定する必要があります。例外の詳細は、[ウィンドウ] > [ビューの表示] > [エラー ログ] に記録されます。