【问题标题】:Xamarin.Android No style resource foundXamarin.Android 找不到样式资源
【发布时间】:2018-05-22 21:21:49
【问题描述】:

我在 MacOS 上将 Xamarin 用于 android 应用程序,我的问题很简单,但我没有在网上找到任何东西,我对此感到很生气:我只想将应用程序样式设置为全屏且没有一个标题栏,所以我更改了我的Manifest.xml 如下:

<uses-sdk android:minSdkVersion="23" /> <application android:allowBackup="true" android:icon="@mipmap/icon" android:label="@string/app_name" android:theme="@android:style/Theme.Material.NoTitleBar.FullScreen"></application>

当它尝试编译时,它给了我以下错误:No resource found that matches the given name (at 'theme' with value '@android:style/Theme.Material.NoTitleBar.FullScreen')(APT0000)

我尝试了所有其他全屏主题,并且没有 Xamarin 在设计器的下拉菜单中建议的标题栏,但它总是给我资源错误

【问题讨论】:

  • 你的minSdkVersion 是什么?您在哪个 Android 版本上测试应用?

标签: android xml xamarin


【解决方案1】:

我只想将应用样式设置为全屏且没有标题栏

你可以在你的AppTheme添加这个:

  <item name="android:windowNoTitle">true</item>
  <item name="android:windowFullscreen">true</item>

而且你的应用不需要改动,参考一下即可:

<application android:allowBackup="true" 
               android:icon="@mipmap/ic_launcher" 
               android:label="@string/app_name" 
               android:roundIcon="@mipmap/ic_launcher_round" 
               android:supportsRtl="true" 
               android:theme="@style/AppTheme">
 </application>

我在source code 中找不到style/Theme.Material.NoTitleBar.FullScreen。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-21
    • 2015-04-11
    • 2023-02-10
    • 1970-01-01
    相关资源
    最近更新 更多