Skip to main content Skip to footer

How to Change the Android Theme for Xamarin Apps

Using system themes help conform app styles and reduce the variance that users encounter. Unlike Windows Phone where you can let the user choose a light or dark theme for your app, the Android theme is typically set once-and-for-all by the developer. Unless you create your own custom theme, you must choose a side: light or dark? When you create a new Xamarin Android app it will have the device default dark theme. You can switch your app to use the light theme by setting the Theme in the AndroidManifest.xml (located in the Droid project under the Properties node). AndroidManifest-theme Dark themes do not use the word ‘dark’ since it’s the default. Not setting the theme is the same as setting it to this:


android:theme="@android:style/Theme.DeviceDefault"  

The device default themes will vary based on the Android version of the device. With this theme you are mainly controlling light versus dark. The device default is a good choice if you want to target older devices while not holding back the cutting edge styles. Each device has theme information already installed and your app is basically taking advantage of it. But as Android continues to evolve, more themes are developed and, depending on the version of the device, it may not support the newer material theme. Here are some examples of the available themes.

The Holo Themes

The Holo theme was introduced with Android 3.0 (Honeycomb) and required on all devices running Android 4.0 and higher. Since Android 4.0 is still a practical minimum target for most apps (as of this writing), it’s a safe pick if you want a consistent look on all devices.


android:theme="@android:style/Theme.Holo"  
android:theme="@android:style/Theme.Holo.Light"  
android:theme="@android:style/Theme.Holo.Light.DarkActionBar"  

There are three themes included with the Holo themes: light, dark and light with dark action bars. Android-Holo-Themes

The Material Themes

The material theme is the latest system theme and it’s only available on Android 5.0 (API 21) and above. You can customize the color palette, animations and transitions with this theme to match your brand.


android:theme="@android:style/Theme.Material"  
android:theme="@android:style/Theme.Material.Light"  
android:theme="@android:style/Theme.Material.Light.DarkActionBar"  

Android-Material-Themes

Download Now!<%/if%>

comments powered by Disqus