网上的各种解决方案已经不少了,但是不适合于我的,谷歌一种新的解决方案
you can directly specify it in manifest file
1 2 3 4 |
|
There are 3 themes available Theme.Holo.Light/Theme.Holo.Dark/Theme.Holo.Light.DarkActionBar.
Theme.Holo.Light requires API level >=11 while Theme.Holo.Dark/Theme.Holo.Light.DarkActionBar requires API level >= 14
If you want to change themes according to API level, you can specify a base appTheme, and override it in style files
1 2 3 4 |
|
values/styles.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
values-v14/styles.xml
1 2 3 4 5 6 7 8 9 10 11 |
|
If you want a consistent theme while maintain compatibility with lower API levels, look at what these people are doing op
The second solution is to request ActionBar feature manually instead making the theme do it for you. I am too lazy to try it myself. This link explain it pretty well. op