How to get Holo Light theme working in my Xamarin application

依然范特西╮ 提交于 2019-12-03 04:22:15

You can use Attributes to modify values in the AndroidManifest.xml, for example this changes the theme to holo light:

[Activity(
    Label = "Foobar",
    MainLauncher = true,
    Theme = "@android:style/Theme.Holo.Light"
)]
public class MainActivity : Activity { ... }

You can also do this at the Application level.

But for your specific problem, it seems that you are naming your style files FsmTheme.xml. That is incorrect. You must name any styling resources styles.xml, so if you rename your files to Resources/values/styles.xml and Resources/values-v11/styles.xml everything should work as expected.

The breakdown is on this line.

<application android:label="FutureState App Demo" android:icon="@drawable/Icon" Theme="@style/FsmTheme" />

Some of the tutorials out there show

Theme="@style/ThemeName"

but you should actually structure it the same as the rest of the element

android:theme="@style/ThemeName"

So the final structure will read

<application android:label="FutureState App Demo" android:icon="@drawable/Icon" android:theme="@style/FsmTheme" />
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!