Did any of you successfully make use of the "Adaptive Icons" for xamarin android, introduced in Oreo?
I managed to make it work, if the .png images are placed in the Drawable-folders, but not if they are placed in the MipMap-folders.
I have followed the guidelines in this link, and it works when using Android Studio... weird I think?
https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive.html
答案 0 :(得分:4)
感谢this blog post,我能够在Xamarin.Forms Android应用中使用自适应图标。
涉及的步骤
Image Asset
。)mipmap-*
文件夹复制到Xamarin.Forms Android项目Resources
目录中。AndroidManifest.xml
以包含新的icon
和roundIcon
资产
<application android:label="MyApp"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:appCategory="productivity"></application>
Icon
和RoundIcon
的值
namespace MyApp.Droid
{
[Activity(Label = "MyApp", Icon = "@mipmap/ic_launcher", RoundIcon = "@mipmap/ic_launcher_round", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
答案 1 :(得分:2)
据说xamarin android mipmap文件夹中有一个错误,可以很好地解释here以及Release Notes
还有一些bugzilla报告:
https://bugzilla.xamarin.com/show_bug.cgi?id=56146
https://bugzilla.xamarin.com/show_bug.cgi?id=59904
希望它有所帮助!