关于listview分割线的问题 你直接设置item于上端和下端的距离就行了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我的实现方式:1、隐藏默认分割线mListView.setDividerHeight(0);mListView.setCacheColorHint(0);2、重写适配器的getView,自定义Item的布局<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@color/app_background"> <LinearLayout android:layout_width="match_parent" android:layout_height="0dip" android:layout_weight="1" android:orientation="horizontal" android:gravity="center_vertical" android:background="@drawable/list_item_bg"> <TextView android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1"/> <TextView android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" /> <ImageView android:layout_width="25dip" android:layout_height="25dip"/> </LinearLayout> <View android:layout_width="match_parent" android:layout_height="1dip" android:layout_marginLeft="15dip" android:layout_marginRight="15dip" android:background="@color/line_gray"/> <View android:layout_width="match_parent" android:layout_height="1dip" android:layout_marginLeft="15dip" android:layout_marginRight="15dip" android:background="@color/write"/></LinearLayout>view就是分割线,设置android:layout_marginLeft="15dip",android:layout_marginRight="15dip"就能够实现了。整体效果如下: 下面的两个View是干啥的?那就是分割线,一条黑的一条灰的,有凹凸效果。效果上图了呵。 内存问题 为什么我下载别人的android代码运行却又错误,空指针 如何在activity中禁用状态栏status bar 安装新版本,如何覆盖安装以保留旧版本的数据 Android系统起来后,第一次可以解锁,运行了一段时间屏幕再锁就再也解不开,触摸屏驱动工作正常 SoundPool播放wav和ogg的问题 哪里可以下载到android cts? ListView 间隔的颜色 如何在程序中修改一个小小属性? 怎样实现textview里显示的缩略图,点击查看大图的效果 RadioButton切换 weiview打开页面的问题
1、隐藏默认分割线
mListView.setDividerHeight(0);
mListView.setCacheColorHint(0);
2、重写适配器的getView,自定义Item的布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/app_background"> <LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:orientation="horizontal"
android:gravity="center_vertical"
android:background="@drawable/list_item_bg"> <TextView
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"/> <TextView
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" /> <ImageView
android:layout_width="25dip"
android:layout_height="25dip"/>
</LinearLayout>
<View android:layout_width="match_parent"
android:layout_height="1dip"
android:layout_marginLeft="15dip"
android:layout_marginRight="15dip"
android:background="@color/line_gray"/>
<View android:layout_width="match_parent"
android:layout_height="1dip"
android:layout_marginLeft="15dip"
android:layout_marginRight="15dip"
android:background="@color/write"/></LinearLayout>view就是分割线,设置android:layout_marginLeft="15dip",android:layout_marginRight="15dip"就能够实现了。整体效果如下:
那就是分割线,一条黑的一条灰的,有凹凸效果。效果上图了呵。