I have this layout in my application, the problem is, the ImageView which has the ID overlay, does not show up over the others, and when I check the layout with Android SDK Hierarchy viewer tool, that ImageView has 0 height, placed at the bottom of the layout. What am I missing? Or what is the reason?
Thanks.
NOTE: This problem does not occur when I replace that view with a Button in the same condition. But it occurs with a View, or ImageView.
EDIT: I am using mentioned ImageView to make the whole view a bit reddish, and I’m using it as a ListView item.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/image" />
<ImageView
android:id="@id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"/>
<ImageView
android:id="@+id/overlay"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="#77ff0000" />
</RelativeLayout>
This is what I see with your xml(with dummy text and image)
1.) Is this what you want? I ll be surprised if you are not seeing this
2.) If this forms your individual list item xml then in your main list xml make sure you have this as your parameters
or you might not see the edges of this item (the text and the image and you might see only the red overlay, or the text and image might get overlapped)
EDIT:
If this is what you want – so that the list item now forms a list item like state then
Modify your code to
Change Image and text to what you want at runtime