Material Date Picker Custom Styling

前端 未结 4 841
清酒与你
清酒与你 2021-02-09 03:18

i have used range date picker from google material with this library

implementation \'com.google.android.material:material:1.2.0-alpha02\'

4条回答
  •  伪装坚强ぢ
    2021-02-09 04:01

    Basically, you should play with styles. In your AppTheme add an item materialCalendarTheme with your custom style that inherits parent ThemeOverlay.MaterialComponents.MaterialCalendar, and change the style.

    1. Change text field - call MaterialDatePicker.Builder function setTitleText()
    2. Make dialog not full screen - you can't change it for date range picker, the documentation says that it is fullscreen by default

    Mobile date range pickers allow selection of a range of dates. They cover the entire screen.

    Here's documentation https://material.io/components/pickers

    Here's how I tweaked some colors to match my theme:

    
    
    
    
    
    
    
    

提交回复
热议问题