0

私はLinearLayoutを持っており、その中に他の2つのLinearLayoutがあります。それぞれにImageViewがあります。このLinearLayoutを、アプリの他のすべてのLinearLayoutの背景として設定する必要があります。「Include」と「Merge」を試してみましたが、「backgroundLinearLayout」内に他のLinearLayoutを配置する必要があるため、機能しませんでした。次に「Styles」を試してみましたが、ImageViewsを内部に追加する方法がわかりません。 LinearLayouts。可能です?最後に、今は「Drawable」を試していますが、それが解決策かどうかはわかりません。

アイデアが必要です。助けが必要です。誰かが私を助けてくれますか?

これは私の「背景LinearLayout」です。

<?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="@layout/gradient_background">

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center_horizontal"
    android:layout_marginTop="170dip"> 

    <ImageView
        android:id="@+id/background_title"
        android:src="@drawable/titulo_fondo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

</LinearLayout>

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="left|bottom"
    android:layout_marginLeft="-54dip"
    android:layout_marginBottom="-24dip"> 

    <ImageView
        android:id="@+id/background_logo"
        android:src="@drawable/circulo_logo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

</LinearLayout> 

</LinearLayout>

私の貧弱な英語に感謝し、申し訳ありません

4

1 に答える 1

0

スタイルはおそらく行く方法です。以下のようなスタイルを作成してみてください。

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyTheme" parent="@android:style/Theme.Light">
<item name="android:windowBackground">@drawable/my_image</item>
</style>

マニフェストのテーマ属性を使用して、アプリ全体を使用するように構成します。

<application
   android:icon="@drawable/icon"
   android:label="@string/app_name"
   android:theme="@style/MyTheme"
   ...
</application>
于 2012-06-07T18:11:21.220 に答える