MvvmCross 3.0.14 - MvxListView selection not working in Android

拈花ヽ惹草 提交于 2019-12-11 03:46:33

问题


I have updated the MvvmCross library from 3.0.12 to 3.0.14 and the items selection stopped working for MvxListViews.

I've created a simple example from the first demo application to display this. The project contains two solutions with the same code but different versions of the MvvmCross Library.

  • 3.0.12 version works well (selected items keeps checked)
  • 3.0.14 version breaks the behavior

Do i have to change something in my code or is it a bug of the Framework?

I am using API Level 12 for the project.

The drawable for the ListView items is the following:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="@color/list_item_pressed" android:state_pressed="true"/>
    <item android:drawable="@color/list_item_selected" android:state_selected="true"/>
    <item android:drawable="@color/list_item_selected" android:state_activated="true"/>
    <item android:drawable="@color/list_item_default"/>

</selector>

And i am selecting the items through the SetItemChecked(position, isChecked); method.


回答1:


This issue is fixed in MvvmCross 3.1.1. See the Github comments for more information: https://github.com/MvvmCross/MvvmCross/issues/481#issuecomment-34273157



来源:https://stackoverflow.com/questions/20332241/mvvmcross-3-0-14-mvxlistview-selection-not-working-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!