Hello,
Welcome to our Microsoft Q&A platform!
I set the icon in the App.xaml.cs
of Xamarin.Forms. Just with icon's name like following code
protected override async void OnStart()
{
try
{
await AppActions.SetAsync(
new AppAction("app_info", title: "Add new note", icon: "hamburger"),
new AppAction("Favourites", title: "View favourites", icon: "plus"));
}
catch (FeatureNotSupportedException ex)
{
// Log error and handle this Exception properly
}
}
For Android, I put the image to drawable
folder like following screenshot.
Here is running screenshot.
For iOS, I put the image to Assets
like following screenshot.
Here is running screenshot.
But the hamburger icon do not show correctly. Based on my research, AppAction's the Icon achieved by UIApplicationShortcutIcon in the iOS., UIApplicationShortcutIcon
has a limitation In the Apple's article, so when we set colorful icon, It only shows an outline with black background. It is by design.
Icons should be square, single color, and 35x35 points, as shown in these template files and as described in Template Images in UIKit User Interface Catalog and in iOS Human Interface Guidelines.
Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.