An app icon is the visual identifier users see in store listings, search results, notifications, and on a device before launching an app. Replacing the default .NET icon gives the application a distinctive, polished identity. section 12.1 section 12.4
Replace the default .NET MAUI icon
For MauiStockTake, copy icon-bg.svg and icon-fg.svg into Resources/AppIcon. Keep the default filenames by deleting appicon.svg and appiconfg.svg, then renaming the supplied files. In the project file, define a MauiIcon item with Include for the main icon and ForegroundFile for the foreground layer. Clean and rebuild, remove the app from the device or simulator, and run it again to verify the updated icon. section 12.1.1
Compose a .NET MAUI app icon from up to four layers:
- Set a background color with BackgroundColor. section 12.1.2
- Add the primary icon with Include. section 12.1.2
- Overlay an icon foreground with ForegroundFile. section 12.1 section 12.1.2
- Apply a tint with TintColor; use hex colors or statically defined .NET MAUI colors. section 12.1.2
Use SVG files where possible because they scale without losing fidelity. .NET MAUI uses Resizetizer to generate the required image sizes and platform assets automatically; generated images are PNG files when referenced by application code. section 12.1.3 section 12.4
Figure 12.4 An app icon in .NET MAUI can be composed of four layers: a background color, an icon, a foreground icon, and a tint color.
Use the layered composition diagram to distinguish the background color, primary icon, foreground image, and tint color. section 12.1.2
