Spinner inner padding is larger on Android 6.0.1

后端 未结 2 1975
借酒劲吻你
借酒劲吻你 2020-12-31 03:18

Intro:

With the new release of Android 6.0.1, seems like Android made some changes on the Spinner component because by default, the inner padding ar

2条回答
  •  自闭症患者
    2020-12-31 03:46

    I had the same issue and my plan was to rollback the 6.0.1 update for v23 only.

    1. Make sure your Spinner has a style attached to it. For example style named as Widget.Spinner in example below:
    
    
    1. Create (if already does not exist) styles.xml under values-v23 directory (for changes will be applied to API v23 only). For example, see Widget.Spinner style definition example below:
    
    
        
    
    

    The style's parent is Widget.AppCompat.Spinner and it redefines it's android:background with the one we will be rolling back from 6.0.1 source.

    Note, that if you're targeting other versions too, you will need to add a default styles.xml under values directory with entry