0

私は 2 TabActivity コントロールを使用しているアプリケーションに取り組んでいます。全画面をカバーするタブの背景画像を設定すると、タブコントロールもカバーされます。ただし、タブ コントロールは画像の背面に残ります。これは本当に奇妙な動作です。誰でも私を助けてください。

メイン タブ コントロールのコードは次のとおりです:\

<?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">
 <LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="5dp">
    <TabWidget
        android:id="@android:id/tabs"
        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" />
</LinearLayout>

背景を追加するタブのコードは次のとおりです。

タブ 1:

public class FirstTab extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);

    /* First Tab Content */
    TextView textView  =(TextView) findViewById(R.id.textview);
    textView.setText("First Tab");
}

}

main.xml

<?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" 
      android:background="@drawable/lux">

<TextView
    android:id="@+id/textview"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/hello" />

</LinearLayout>

ルクスの画像がフルスクリーンで表示される...タブの下に表示したい。どんな助けでも大歓迎です。

4

1 に答える 1

0
<?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" 
      android:background="@drawable/lux">

親のレイアウトセットの高さと幅を塗りつぶし、それをwrap_contentにして、タブに収まるようにルクスの画像サイズを非常に小さく保つか、dpの高さと幅を48dp/64dp/72dp/96dpにすることを確認してください

于 2012-12-07T12:21:19.767 に答える