Skip to content Skip to sidebar Skip to footer

MvvmCross - MvxListView Binding Multiple Clicks

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 MvxLis

Solution 1:

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


Solution 2:

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

<Mvx.MvxListView
                local:MvxBind="ItemsSource Favourites; ItemClick ShowFavouriteCommand"
                ...
                android:choiceMode="singleChoice"
                android:id="@+id/listFavourites" />

Post a Comment for "MvvmCross - MvxListView Binding Multiple Clicks"