I'm trying to get my app to use the Holo.Light theme. I've created a custom theme for Holo and put it in
Resourses\values-v11\FsmTheme.xml
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="FsmTheme" parent="@android:style/Theme.Holo.Light">
</style>
</resources>
I've also created one for older versions and put it in
Resourses\values\FsmTheme.xml
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="FsmTheme" parent="@android:style/Theme.Light.NoTitleBar">
</style>
</resources>
Then I added it to my AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" android:versionCode="001" android:versionName="001" package="futurestate.app.droid">
<uses-sdk android:minSdkVersion="12" android:targetSdkVersion="14" />
<application android:label="FutureState App Demo" android:icon="@drawable/Icon" Theme="@style/FsmTheme" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
I'm not sure what else I would need to do to get the theme to take in the app.
Set the current user themeUserAppTheme = OSAppTheme. Dark; In this example, the application is set to use the theme defined for the system dark mode, regardless of which system theme is currently operational. Set the UserAppTheme property to OSAppTheme.
First, we populate a list with the options the user can choose from: the device default, or a light or dark theme. Then we define a command which handles tapping on an option from the list. The command immediately sets the theme and stores this preference using the awesome Xamarin. Essentials Preferences APIs.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With