Reputation: 11999
Xamarin.Forms does generate a greyish Android application. I'd like to have a light / white theme in Android (like in the iOS target).
Does a simple way to switch exist?
Upvotes: 38
Views: 30137
Reputation: 71
open android manifest file app_name->Properties->AndroidManifest.xml
now add this line inside <manifest>
:
<manifest>
...
<application android:theme="@android:style/Theme.DeviceDefault.Light"></application>
...
</manifest>
Upvotes: 0
Reputation: 3197
You can put Theme parameter to ApplicationAttribute of your main activity
like this
[assembly: Application(Icon = "@drawable/Icon", Theme = "@android:style/Theme.Holo.Light")]
Or you can put this string to AndroidManifest.xml
<application android:theme="@android:style/Theme.Holo.Light" />
Upvotes: 74
Reputation: 2430
The answer from ad1Dima got me most of the way there, but I found that in my environment I needed something slightly different. This is what I put in my 'MainActivity.cs' file to change the theme.
[Activity( Theme="@android:style/Theme.Holo.Light",Label = "HealthTechnologies", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : AndroidActivity
Note that the only thing that was new here was the addition of the 'Theme=...'. Everything else was already in the MainActivity.cs file.
Upvotes: 8