Search code examples
androidadtlook-and-feelandroid-themeeclipse-adt

Android Widget Look and Feel Different When Running


I am using Eclipse ADT to develop my first Android application.

In Eclipse you can change the theme using the menu shown in the Graphical Layout window. I decided to use the Black theme because I like the way the UI components look using that theme.

select theme

One of my UI widgets is a seek bar. Here is how it looks using the Black theme:

seek bar black theme

When I test (run) my application using the Nexus S virtual device the seek bar looks different:

seek bar nexus s

Why do they look different? (I am guessing that Eclipse is just showing me a preview of what that theme would look like and not actually setting it anywhere and that when I run my app it inherits the theme from the target platform.) Is there a way I can force the look and feel of my app?

Thank you.


Solution

  • Because the Android UI has evolved and changed. The first image you posted is Android 2.2 (ish) and then the second image looks like Android >= 4.0.

    Secondly, AFAIK, changing the theme from that menu is ONLY for checking out the apps UI within the GUI layout editor - it will not change the theme on launch within the emulator, or a real device. For that you need to specify the theme within your manifest.

    You can change the version of Android being used in the preview too, using the Android icon on the far right of the GUI editor. You can also preview more than one at a time using the far left icon on the same toolbar.