Hi i'm developing app using Xamarin.Forms PCL based solution.For my app i need Listview ViewCell Contextaction. I referred this document to add the contextActions.When i ran it in android the icon is displaying.but in iOS it is not working.
Xaml code
<ViewCell.ContextActions>
<MenuItem Text="Edit" x:Name="MenuEdit" />
<MenuItem Clicked="OnDeleteMenu" Icon="dustbin.png" Text="Delete" IsDestructive="true"
CommandParameter="{Binding .}" />
</ViewCell.ContextActions>
Please anyone give the solution or related sources.
I asked Xamarin support the same question few weeks ago.
Below is the answer I got:
iOS does not support icons in the context menus like Android. You can use something like this to support both platforms:
<MenuItem Icon="dustbin.png" Clicked="OnDeleteMenu" Text="Delete"/>
This will show the text on iOS and the Icon on Android.
If you would like to see this feature added to Xamarin.Forms, please add a new post to https://xamarin.uservoice.com/forums/258559-xamarin-forms-suggestions.
:D I found the solution for icon on iOS by using font. ex: Text="❤ Favorite"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With