IntelliJ IDEA 12 - Android GUI designer does not successfully change app theme

The Android GUI Designer in IntelliJ has a dropdown to select Framework Themes. The problem is that changing this doesn't affect what appears in the emulator when testing my application. No matter what is selected, the app theme is always the default black bare theme (Theme.Holo I guess.) I'd like it to be Theme.Holo.Light - but it doesn't really matter which one I am choose.

Anyone have any tips for creating this work in a designer?

+3


source to share


3 answers


The theme must be set manually in the file AndroidManifest.xml

, in the GUI designer this parameter is only used to preview how your application will look like different themes.



+2


source


"If you want the theme to apply to a single action in your application, add the android: theme attribute to the tag."

eg.

   <activity android:name="MainActivity"
              android:label="@string/app_name"
              android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">

      



"To set a theme for all actions in your application, edit the tag to include the android: theme attribute with the style name

  <application android:theme="@style/CustomTheme">

      

0


source


Like CrazyLoader, you need to change the theme manually in the file AndroidManifest.xml

. For example, if I want to change the theme for all actions in my application to Holo.Light

, I will do this:

 <application
      android:label="@string/app_name"
      android:icon="@drawable/ic_launcher"
      android:theme="@android:style/Theme.Holo.Light>

      

and if I want the theme to be applied to individual activities I will do the following:

<activity
        android:name="MainActivity"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Holo.Light">

      

Note. If yours is minSDK

set to anything less than API 11, you will get the following error:

@android: style / Theme.Holo.Light requires API level 11 (current minimum 8)

0


source







All Articles