Mat*_*ard 8 xamarin.android android-8.0-oreo
你们中的任何人是否成功利用了Oreo中引入的适用于xamarin android的“自适应图标”?
如果.png图像放置在Drawable文件夹中,但如果将它们放置在MipMap文件夹中,则设法使它起作用。
我已遵循此链接中的准则,并且在使用Android Studio时可以使用...我觉得很奇怪吗?
https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive.html
感谢这篇博客文章,我能够在Xamarin.Forms Android应用中使用自适应图标。
涉及的步骤
Image Asset在编辑器首次初始化时,您可能需要一段时间才能在Android Studio中实际添加新图标。)mipmap-*夹复制到Xamarin.Forms Android Project Resources目录中。AndroidManifest.xml以包含新的icon和roundIcon资产
<application android:label="MyApp"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:appCategory="productivity"></application>
Run Code Online (Sandbox Code Playgroud)
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
{
Run Code Online (Sandbox Code Playgroud)
据说 xamarin android mipmap 文件夹中有一个错误,在此处以及发行说明中都有很好的解释
还有一些 bugzilla 报告:
https://bugzilla.xamarin.com/show_bug.cgi?id=56146
https://bugzilla.xamarin.com/show_bug.cgi?id=59904
希望能帮助到你!
| 归档时间: |
|
| 查看次数: |
2603 次 |
| 最近记录: |