I've been experiencing some problems with the RelativeLayout when it
is used within a ListView item. I've created a simple example of the
problem below.
RelativeLayoutInListItemTest.java
public class RelativeLayoutInListItemTest extends ListActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ArrayList<Map<String,String>> al = new
ArrayList<Map<String,String>>();
al.add(new HashMap<String,String>());
al.add(new HashMap<String,String>());
al.add(new HashMap<String,String>());
SimpleAdapter sa = new SimpleAdapter(this, al,
R.layout.relative_layout_in_list_item, new String[]{}, new int[]{});
setListAdapter(sa);
}
}
relative_layout_in_list_item.xml
<?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="wrap_content"
>
<TextView
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:text="Left Center"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<LinearLayout
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:text="Upper"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<TextView
android:text="Lower"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
</LinearLayout>
</RelativeLayout>
Notice how only the lower half of "Left Center" is displayed. Also,
notice that "Upper" is not displayed.
Can someone confirm that this is a bug or point out my mistake?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---