Daniel Hilgarth
Daniel Hilgarth

Reputation: 174369

How to fix styling of app

I am having a really hard time with the styling of my Android application, check out the screenshot:

Screenshot

The screenshot is from a Android 4.0.3 emulator, so I expect the new looks.

There are several problems with it:

  1. The black border around the title of the alert dialog
  2. The blue border around the whole alert dialog
  3. The NumberPicker looks like Android 2.0
  4. The buttons should be black and with no space between them and the border of the dialog

My Styles.xml looks like this:

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <style name="Theme.Splash" parent="android:Theme">
    <item name="android:windowBackground">@drawable/splash</item>
    <item name="android:windowNoTitle">true</item>
  </style>
  <style name="Theme.Recson.BlueBackground" parent="android:Theme">
    <item name="android:background">#ff2390C8</item>
  </style>
  <style name="Theme.Recson.NoActionBar" parent="Theme.Recson.BlueBackground">
    <item name="android:windowNoTitle">true</item>
  </style>
</resources>

The activity that spawns this alert dialog uses Theme.Recson.BlueBackground. Not specifying any theme for the activity makes it look the way I want it to - except for the missing blue background:

So, I guess, the question is: How to fix my theme?

Upvotes: 2

Views: 77

Answers (1)

nhaarman
nhaarman

Reputation: 100438

Try using parent="android:Theme.Holo".

Of course, this is only available from API level 11 and up, so you will have to create a separate styles.xml file and place it in the values-v11 folder. In the default styles.xml file use your existing configuration, in the v11 file, you can use Theme.Holo.

Have a look at Styles and Themes - Select a theme based on platform version | Android Developers.

Upvotes: 2

Related Questions