私はアンドロイド2.2でアクションバーのようなものを実装しようとしています。 これは私の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"
>
<include
android:id="@+id/header"
layout="@layout/header"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/dark_button"
>
<Button
android:id="@+id/brand_id"
android:layout_width="fill_parent"
android:layout_height="80dip"
android:text="@string/brand_label"
android:textColor="@color/white"
android:background="@drawable/dark_button"
/>
<Button
android:id="@+id/car_id"
android:layout_width="fill_parent"
android:layout_height="80dip"
android:text="@string/car_label"
android:textColor="@color/white"
android:background="@drawable/dark_button"
android:visibility="gone"
/>
<Button
android:id="@+id/model_id"
android:layout_width="fill_parent"
android:layout_height="80dip"
android:text="@string/model_label"
android:textColor="@color/white"
android:background="@drawable/dark_button"
android:visibility="gone"
/>
<Button
android:id="@+id/location_id"
android:layout_width="fill_parent"
android:layout_height="80dip"
android:text="@string/location_label"
android:textColor="@color/white"
android:background="@drawable/dark_button"
android:visibility="gone"
/>
<Button
android:id="@+id/submit"
android:layout_width="fill_parent"
android:layout_height="80dip"
android:text="@string/submit_label"
android:textColor="@color/white"
android:layout_marginTop="10dip"
android:background="@drawable/dark_button"
android:visibility="gone"
/>
<ProgressBar
android:id="@+id/mainProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
であり、これは私が、私はコードと間違っているものを疑問に思って
としてのO/Pを取得しています私のheader.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="match_parent"
android:orientation="horizontal"
>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:layout_weight="1" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/logo_toyota"
android:layout_weight="1" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:layout_weight="1" />
</LinearLayout>
です。私はアンドロイド開発に新しいです。どんな助けも高く評価されます。 =オリエンテーション:それはmain.xml
のルートレイアウトでは、デフォルト
によって設定されているので、それを水平方向に示したされ、事前 アマンゴータム
問題を説明するのを忘れましたか? – waqaslam
ああ申し訳ありません!私は精巧にしなければならないと思った。含まれている部分だけがmain.xmlに見える。ボタンも表示されるはずです。私は何が間違っているのか分からない。 –