你们中的任何人是否成功利用了Oreo中引入的适用于xamarin android的“自适应图标”?
如果.png图像放置在Drawable文件夹中,但如果将它们放置在MipMap文件夹中,则设法使它起作用。
我已遵循此链接中的指南,并且在使用Android Studio时可以使用...我觉得很奇怪吗?
https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive.html
最佳答案
多亏了this blog post,我才能够在Xamarin.Forms Android应用中使用自适应图标。
涉及的步骤
Image Asset
。)mipmap-*
-folder复制到Xamarin.Forms Android项目Resources
目录中。 AndroidManifest.xml
以包含新的icon
和roundIcon
Assets <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
{
关于xamarin.android - Xamarin Oreo自适应图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47864285/