MvvmCross - MvxListView binding multiple clicks

前端 未结 2 1838
情话喂你
情话喂你 2020-12-21 15:26

I am developing an app using MvvmCross and I am having problems in the android app setting up the binding to catch a click operation in two different controls that make up a

相关标签:
2条回答
  • 2020-12-21 15:41

    I think you are missing android:choiceMode="singleChoice"

    <Mvx.MvxListView
                    local:MvxBind="ItemsSource Favourites; ItemClick ShowFavouriteCommand"
                    ...
                    android:choiceMode="singleChoice"
                    android:id="@+id/listFavourites" />
    
    0 讨论(0)
  • 2020-12-21 15:50

    I've encountered this before. The button in your MvxItemTemplate layout is stealing focus. Try setting android:focusable="false" for the button in your layout.

    Changing focus from Button in ListView row to list item

    I am updating this answer to be more thorough. While setting android:focusable="false"for a common Button control in a ListView Item fixes the issue. If you are using an ImageButton this will not work.

    For an ImageButton you need to set android:descendantFocusability="blocksDescendants" on the root view of your layout.

    See the accepted answer here: can't click on listview row with imagebutton

    0 讨论(0)
提交回复
热议问题