Disappearing Views
I have a fairly standard layout for the first screen of the setup wizard on my app. I have been developing it with a solid color background which I defined in a theme. I have recently got a png file that I would like to used as the background. This works fine on all screens apart from the 3 screens for the setup wizard. The problem being that only the first textview is drawn. I used the hierachy viewer and the other views where not listed.
These are the only screens that use an include statement so I suspect this may be the root of the problem but even if I take out the include statement I still have the problem.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/welcome"
android:text="@string/welcome"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dip"
android:gravity="center_horizontal"
android:textColor="#433A33"
android:textStyle="bold">
</TextView>
<ImageView
android:id="@+id/mainIcon"
android:src="@drawable/main_icon"
android:layout_width="100dip"
android:layout_height="100dip"
android:layout_centerHorizontal="true"
android:layout_below="@+id/welcome">
</ImageView>
<TextView
android:id="@+id/description"
and开发者_如何学Croid:text="@string/description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dip"
android:layout_below="@+id/mainIcon"
android:gravity="center_horizontal"
android:textColor="#433A33"
android:textSize="15dip">
</TextView>
<TextView
android:id="@+id/choice"
android:layout_below="@id/description"
android:text="@string/choice"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dip"
android:gravity="center_horizontal"
android:textColor="#433A33"
android:textSize="15dip">
</TextView>
<Spinner
android:id="@+id/language"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/choice"
android:prompt="@string/languagePrompt"
android:textSize="10dip"
android:layout_marginRight="20dip"
android:layout_marginLeft="20dip">
</Spinner>
<include layout="@layout/wizard_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
</RelativeLayout>
Let me know if anybody has any ideas.
Edited to show the problem with a screen shot
The problem was that the theme I was using was setting the background to all Views rather than just the window background. So the background that is in the screen shot is the background for that one imageView and all the other views where pushed off the page.
I changed the them accordingly and it working fine now
精彩评论