[mono-android] Android Theme in activity
rogerncormier74
roger.cormier at highjump.com
Thu Jan 26 14:58:11 UTC 2012
I am trying to get a custom theme I created working.
I just want to attempt to change the background of the activities from its
default black color to start.
I'm having some problems and wondering if anyone has an idea for this.
I've noticed you can try to do this in a few different ways.
One of the ways would be in the Android manifest file so that all the
activities would use the theme.
Here is my theme I created (I put this in Resources\Values\Themes.xml):
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
This is how my Android Manifest looks:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="internalOnly" android:versionCode="1"
package="test.TestAndroidTablet" android:versionName="1">
<application android:label="TestAndroidTablet">
android:theme="@style/theme"
</application>
<uses-sdk android:minSdkVersion="12" />
</manifest>
If I do this, the background color is not changed at all.
I then try to change the theme through code in 1 activity only by calling
SetTheme(Resource.Style.Theme); in the activity OnCreate(). This changes
the background color white in that activity but I notice that the Activity
no longer looks like an Activity from SdkVersion 12 (Tablet look with action
bar on top), it looks like a Android version 2 look. Any idea why this
would happen?
I would personally prefer to be able to just be able to set it the 1 time in
the Android Manifest but I am also curious why this would happen when I
called it through SetTheme(Resource.Style.Theme);
Thanks,
Roger
--
View this message in context: http://mono-for-android.1047100.n5.nabble.com/Android-Theme-in-activity-tp5433057p5433057.html
Sent from the Mono for Android mailing list archive at Nabble.com.
More information about the Monodroid
mailing list