Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make gui elements like a button on every device look like the native gui in android?

hi i have a question about the gui of a android application.

when i start a project and select 2.3.3 as my api version. i add some gui stuff like a button and then run the code on a 4.0.3 device.

the problem is now: the button looks like a 2.3.3 button and not like the 4.0.3 version.

is there any way to change this?

like image 392
gurehbgui Avatar asked Jul 30 '12 07:07

gurehbgui


1 Answers

You have to use one of the Holo themes for API Level 11+:

  1. Create res/values folder
  2. Define your application theme like this:

    <style name="AppTheme" parent="@android:style/Theme" />
    
  3. Create res/values-v11 folder

  4. Define your application theme like this:

    <style name="AppTheme" parent="@android:style/Theme.Holo.Light" />
    
  5. Use AppTheme in AndroidManifest.xml

For further reading, see section Using Holo while supporting Android 2.x in this article.

like image 153
StenaviN Avatar answered Oct 03 '22 08:10

StenaviN