每个item内的控件布局要有padding,不能完全和边贴上。

解决方案 »

  1.   


     我试过了,没有用唉。 能否请阁下明示:我的代码:
    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="50dp"
      android:gravity="center_vertical"
      android:background="@drawable/white"
      android:padding="1dp"
    >
    <TextView
      style="@style/textView3"
      android:id="@+id/listItemText"
      android:layout_marginLeft="6dp"
      android:layout_alignParentLeft="true"
      android:layout_centerVertical="true"
      android:textColor="@drawable/black"
      android:layout_width="280dp"
      android:singleLine="true"
      android:textSize="20sp"
      
    />
    <CheckBox
      android:id="@+id/listItemCheckBox"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginRight="2dp"
      android:layout_alignParentRight="true"
      android:layout_centerVertical="true"
    >
    </CheckBox>
    </RelativeLayout>
      

  2.   

    RelativeLayout:的高度改成
    android:layout_height="wrap_content"TextView:怎么没有定义高度
    添加android:layout_height="wrap_content"这两个改完试试
      

  3.   

    总结: 这个问题一直没有很好的解决方法。
           listview的分隔线有些显示不出来,这与你的手机有关,我的程序放在htc G7上面,listview中的每一条分隔线都可以显示出来,只是还是会有一种,相邻的item之间的分隔有大有小,并不均匀好看。(这一点,无法与iphone相比)。
           
           期待有更好的解决方法(使用一些布局技巧,能够达到iphone那种效果)