两个背景图像作为android:windowBackground主题

时间:2010-09-17 10:34:20

标签: android background themes

我在一侧有一个自定义可绘制对象,object1.xml:

<drawable ... />

我在另一边有另一个自定义形状对象,object2.xml:

<shape ...><gradient .../></shape>

在每个活动中,我希望将这两个对象作为活动的背景,所以我目前所做的是:

<LinearLayout android:background="@drawable/object1" ...>
<ImageView 
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:background="@drawable/object2"
 .../>
...
<LinearLayout/>

我想要做的是从每个Activity中删除这段代码,并为整个应用程序创建一个自定义主题,包括这个组合背景。

我所取得的成就是以object1为背景创建主题,但无法获取第二个对象。

<resources>
 <style name="CustomDialogTheme" parent="@android:style/Theme.NoTitleBar">
  <item name="android:windowFullscreen">true</item>
  <item name="android:windowBackground">@drawable/object1</item>
 </style>
</resources>

我尝试使用<list-item>,但只是不显示object2。

0 个答案:

没有答案