繁体   English   中英

Android多选ListView不显示Checkmarks

[英]Android multiple choice ListView doesn't display Checkmarks

这是我的ListView的xml:

  <ListView
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:id="@+id/listview"
        android:layout_marginTop="8dp"
        android:layout_weight="8"
        android:choiceMode="multipleChoice"/>

我想在用户检查一个项目时显示复选标记,但是复选框仅将其颜色更改为绿色,并且没有复选标记。 为什么?

我不能发布图片,因为我没有足够的声誉。

用这个 :

 <ListView
    android:layout_width="fill_parent"
    android:layout_height="0dp"
    android:id="@+id/listview"
    android:layout_marginTop="8dp"
    android:layout_weight="8"
    android:choiceMode="singleChoice"/>

这将解决您的问题您可以进一步了解: http//developer.android.com/reference/android/widget/AbsListView.html#attr_android : choiceMode

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM