【发布时间】:2014-05-15 10:02:00
【问题描述】:
我在这里使用了自定义列表视图,并且已经禁用了列表视图的分隔符。
我也尝试了普通的列表视图(不是自定义的),但它仍然没有工作。除了从 xml 中修改之外,还有什么办法吗?
这是列表视图 xml 的代码
<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>
有人可以帮我摆脱分隔线吗? :) 谢谢!
【问题讨论】:
-
一个小建议:在 listView 中设置 layout_weight 会对性能产生显着影响。尝试摆脱它或切换到RelativeLayout
-
好的,我会记住的。谢谢! :)
标签: java android listview divider