Android HoneyComb DatePicker Text Color

后端 未结 5 1921
小鲜肉
小鲜肉 2020-12-03 14:25

I\'m searching for a possibilitie to adjust the text color of the datepicker widget in an android honeycomb app. I knew that the widget inherent the global text-color which

5条回答
  •  北海茫月
    2020-12-03 15:14

    DONE IT

    Did it in a Theme in the application styles.xml (basically set a style on all EditText fields)

    I have this in /values-v11/ so it only affects >HC

    
    
    
        
    
        
    
    
    

    Then in my AndroidManifest, for the Activity that uses the DatePicker:

          
    

    That's it!


    My Working Out:

    I came to this conclusion by checking the DatePicker source:

    https://github.com/android/platform_frameworks_base/blob/master/core/res/res/layout/date_picker.xml

    That showed me the DatePicker used NumberPicker

    https://github.com/android/platform_frameworks_base/blob/master/core/res/res/layout/number_picker.xml https://github.com/android/platform_frameworks_base/blob/master/core/res/res/layout/number_picker_with_selector_wheel.xml

    The NumberPicker uses an EditText

    You can therefore style an EditText

    android : how to change the style of edit text?

    And if you search in this file for "editText" you will see you can set a style on all edittext fields in one Activity!

    https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/themes.xml

    You override this item:

     @android:style/Widget.EditText
    

提交回复
热议问题