Listview Row Overlap Problem

Posted by rgrandy on Stack Overflow See other posts from Stack Overflow or by rgrandy
Published on 2010-02-04T16:00:07Z Indexed on 2010/03/18 22:31 UTC
Read the original article Hit count: 2029

Filed under:
|
|
|

I just updated my app and I am getting some odd complaints from people who update it. I am only getting complaints from people with non-stock android phones (phones that manufacturers have modified...HTC phones, cliq, pulse, etc), other phones like the Droid, Nexus work fine. My app (Photo Frame Deluxe) has a list in it with a Image View, Text View, View (spacer) and checkbox, all in a row. What happens on the affected phones is that the rows start overlapping and it cuts the top half of everything off. My layout code for this is below, I am pulling my hair out on this, what might I have wrong in this layout. Why does this work on some phones and not on others? Any help would be appreciated.

Row Layout:

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
<ImageView
    android:id="@+id/photorowIcon"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical"
    android:paddingTop="10dp"
    android:paddingBottom="10dp"
    android:paddingRight="5dp"
    />
<TextView
    android:id="@+id/photorowText"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical"
    />
<View
    android:layout_width="0px"
    android:layout_height="wrap_content"
    android:layout_weight="1"/>
<CheckBox
    android:id="@+id/photorowCheckBox"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical"
    android:focusable="false"
    android:focusableInTouchMode="false"
    />  
</LinearLayout>

Layout Row is inserted in:

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/title1_gradient"
    android:orientation="vertical">
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Select Photos to Display:"
    android:textSize="20sp"
    android:textStyle="bold"
    android:textColor="#FFFFFFFF"
    android:paddingLeft="5dp"
    android:paddingRight="5dp"
    android:paddingTop="5dp"
    />
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/folderName"
    android:textSize="15sp"
    android:textStyle="bold"
    android:textColor="#FFFFFFFF"
    android:paddingLeft="5dp"
    android:paddingRight="5dp"
    android:paddingBottom="5dp"
    />
    <View
        android:layout_width="fill_parent"
        android:layout_height="1px"
        android:background="#406C6C6C"/>
    </LinearLayout>
<ListView
    android:id="@android:id/list"
    android:layout_width="fill_parent"
    android:layout_height="0px"
    android:layout_weight="1"
    android:drawSelectorOnTop="false"
    android:paddingLeft="5dp"
    android:paddingRight="5dp"
    />
<LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_gravity="bottom">    
    <LinearLayout 
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_gravity="bottom"
            android:background="#FF6C6C6C" 
            android:padding="5dp">
            <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:id="@+id/ok"
                android:text="OK"/>
    </LinearLayout>
</LinearLayout>
</LinearLayout>

© Stack Overflow or respective owner

Related posts about android

Related posts about layout