Setting Holo theme for Android application

后端 未结 3 1168
囚心锁ツ
囚心锁ツ 2020-12-28 10:11

I have a simple login screen with username and password.

I\'d like it to show the EditText fields in the same way as you see in the Holo theme on Ice C

相关标签:
3条回答
  • 2020-12-28 10:48

    The original Android Holo Theme is just for API Level 11+. But there is an open source project called HoloEverywhere.

    Take a look at this. This should solve your Problems.

    So if you refere it as an Library you can set your Theme like this:

    android:theme=“@style/Theme.Holo
    // or if you want to use the Holo light theme:
    android:theme=“@style/Theme.Holo.Light
    
    0 讨论(0)
  • 2020-12-28 10:53

    Try doing it on a per-activity basis. That's how I've always done it. It looks to me like the theme is not taking effect at all in your screenshot. Theme.Holo is dark. The white theme is Theme.Holo.Light.

    <activity
            android:name=".login"
            android:label="@string/login"
            android:noHistory="true"
            android:theme="@android:style/Theme.Holo.Light"/>
    
    <activity
            android:name=".Preferences"
            android:theme="@android:style/Theme.Holo.Light" >
    

    etc rather than in the app level

    Also, to correct Ahmad, Holo is available from Honeycomb and on, or 11+.

    0 讨论(0)
  • 2020-12-28 10:56

    Actually, Holo is available since API 11; it's just Theme.Holo.Light.DarkActionBar that came in API level 14. There is no need for 15+.

    For older API Levels, HoloEverywhere, ActionBarSherlock, ViewPageIndicator and such are neccessary, as mentioned by Ahmad as well.

    0 讨论(0)
提交回复
热议问题