Hi folks,

I have the following layout which defines a "cell" for my list view.

<?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"
  android:id="@+id/CellRLayout"
  android:background="@drawable/cellselector"
  android:minHeight="44dp">
        <ImageView android:id="@+id/CellImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_marginLeft="4dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true" android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"/>
        <TextView android:id="@+id/TextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:textColor="#000000"
android:layout_gravity="left|center_vertical"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
android:layout_centerVertical="true" android:layout_toRightOf="@+id/
CellImageView" android:layout_toLeftOf="@+id/CellAccessoryView"
android:typeface="normal"/>
        <ImageView android:id="@+id/CellAccessoryView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:background="@drawable/
arrow" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_marginRight="8dp"/
>
</RelativeLayout>

So the cell is an image on the left side, some text, and then on the
right side a small arrow.  They're all set to center vertically.

On 1.6 or higher these cells show up perfectly.  On the emulator built
with 1.5 though the two images and text are cut in half vertically.
It looks like it would look if their "origin" was moved to the center
of their view rather than the top left of their view.

Can anyone tell me what I might have configured incorrectly to cause
this?

I create the cells in the getView() method for my custom adapter.  I
inflate them like this:

LayoutInflater inflater = getLayoutInflater();
row = inflater.inflate(R.layout.mycell, parent, false);

I then make use of the wrapper concept, and set the appropriate image
and text for the cell (also done in getView() before returning the
view).

Thanks,

Robert Hawkey

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to