Xamarin.Android没有找到样式资源

时间:2018-05-22 21:21:50

标签: android xml xamarin

我在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在设计器的下拉菜单中建议的标题栏,但它总是给我资源错误

1 个答案:

答案 0 :(得分: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