【问题标题】:how to resolve the 'Theme.AppCompat.Light.NoActionBar' error in xamarin?如何解决 xamarin 中的“Theme.AppCompat.Light.NoActionBar”错误?
【发布时间】:2016-06-02 20:33:06
【问题描述】:

使用 xamarin 构建应用程序,以下是我在构建时遇到的错误尝试从 Theme.AppCompat.Light.NoActionBar 继承时得到这个。我已经有 xamarin.android.support.v4、xamarin.android.support.v7.appcompat 参考并使用 Xamarin.Forms 2.3.0.46 .下面是我使用的 Style.xml 代码

<style name="AppThemeSliderToolbar" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:colorPrimary">#00d1ff</item>
<item name="android:colorPrimaryDark">#40c5e9</item>
</style>

【问题讨论】:

  • 这个错误有什么解决办法吗?

标签: android xml xamarin.android android-theme


【解决方案1】:

您必须在 theme.xml 而不是 styles.xml 上打开此标签,并将“样式名称”更改为“主题名称”

【讨论】:

  • 这个答案是错误的,根据Android docs - Styles and Themes"&lt;style name="CustomTheme" parent="android:Theme.Material.Light"&gt;""For example, here is the declaration for a custom theme. It would go in an XML file under res/values (typically res/values/styles.xml)"
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-11-12
  • 2017-06-22
  • 2020-03-28
  • 2022-10-18
  • 2017-10-06
  • 2020-11-01
  • 2016-12-26
相关资源
最近更新 更多