Created
November 17, 2014 18:24
-
-
Save rmarinho/1f9a7c1032c9964429cf to your computer and use it in GitHub Desktop.
Workaround for Listview SelectedItem issues with buttons on the ViewCell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create a renderer for the viewcell | |
public class CustomCell : ViewCellRenderer | |
{ | |
protected override global::Android.Views.View GetCellCore (Cell item, global::Android.Views.View convertView, ViewGroup parent, Context context) | |
{ | |
var cell = base.GetCellCore (item, convertView, parent, context); | |
(cell as ViewGroup).DescendantFocusability = DescendantFocusability.BlockDescendants; | |
return cell; | |
} | |
} | |
//don't forget to Export the renderer | |
[assembly: ExportRenderer (typeof (ViewCell), typeof (CustomCell))] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment