Skip to content

Instantly share code, notes, and snippets.

@rmarinho
Created November 17, 2014 18:24
Show Gist options
  • Save rmarinho/1f9a7c1032c9964429cf to your computer and use it in GitHub Desktop.
Save rmarinho/1f9a7c1032c9964429cf to your computer and use it in GitHub Desktop.
Workaround for Listview SelectedItem issues with buttons on the ViewCell
//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