简体   繁体   English

MvvmCross 3.0.14-MvxListView选择在Android中不起作用

[英]MvvmCross 3.0.14 - MvxListView selection not working in Android

I have updated the MvvmCross library from 3.0.12 to 3.0.14 and the items selection stopped working for MvxListViews. 我已经将MvvmCross库从3.0.12更新到3.0.14,并且项目选择对于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. 该项目包含两个具有相同代码但MvvmCross库版本不同的解决方案。

  • 3.0.12 version works well (selected items keeps checked) 3.0.12版本运行良好(选中的项目会保持选中状态)
  • 3.0.14 version breaks the behavior 3.0.14版本破坏了行为

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. 我正在为该项目使用API​​级别12。

The drawable for the ListView items is the following: ListView项目的drawable如下:

<?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); 我通过SetItemChecked(position, isChecked);选择项目SetItemChecked(position, isChecked); method. 方法。

This issue is fixed in MvvmCross 3.1.1. 此问题已在MvvmCross 3.1.1中修复。 See the Github comments for more information: https://github.com/MvvmCross/MvvmCross/issues/481#issuecomment-34273157 有关更多信息,请参见Github注释: https : //github.com/MvvmCross/MvvmCross/issues/481#issuecomment-34273157

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

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