Java Android-分隔符已禁用,但仍显示
我在这里使用自定义列表视图,并且已经禁用了列表视图的分隔符 我也尝试了普通的listview(不是自定义的),但仍然不起作用。除了从xml中修改它,还有其他方法吗 下面是listview xml的代码Java Android-分隔符已禁用,但仍显示,java,android,listview,divider,Java,Android,Listview,Divider,我在这里使用自定义列表视图,并且已经禁用了列表视图的分隔符 我也尝试了普通的listview(不是自定义的),但仍然不起作用。除了从xml中修改它,还有其他方法吗 下面是listview xml的代码 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:showDividers="none"
tools:context=".MainActivity" >
<ListView
android:id="@+id/lvListItem"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:divider="@null"
android:dividerHeight="0px" >
</ListView>
有人能帮我把分隔器处理掉吗?:)谢谢 将dividerHeight设置为零,并将divider设置为null,如xml中所示:
android:dividerHeight="0dp"
android:divider="@null"
请注意,0dp
不是0px
。
希望它能起作用一点建议:在listView中设置布局权重会对性能产生显著影响。试着摆脱它或者换个亲戚好吧,我会记住的。谢谢!:)已经试过了,但还是。。哈哈,我对此很好奇。你应该将你的android:layout\u width=“0dp”更改为wrap\u contant或匹配父对象。或者移除所有东西,从头开始