Material 日期选择器选择的日期圆圈偏离中心,如何使它适合中心?
Material date picker selected date circle is out of center ,How to make it fit center?
这是我单独用于material日历的样式,除了选择日期圈外一切都很完美
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@color/colorAppBackground</item>
<item name="android:actionMenuTextAppearance">@style/RobotoMenuText</item>
<item name="titleTextAppearance">@style/RobotoMenuText</item>
<item name="android:windowIsTranslucent">true</item>
<item name="titleTextStyle">@style/RobotoMenuText</item>
<item name="colorSurface">@color/colorAppGreen</item>
<item name="materialCalendarTheme">@style/CalenderTheme</item>
<item name="materialCalendarFullscreenTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar.Fullscreen</item>
<item name="materialCalendarStyle">@style/Widget.MaterialComponents.MaterialCalendar</item>
</style>
<style name="CalenderTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@color/colorAppBackground</item>
</style>
你 have to switch 从 Theme.AppCompat
到 Theme.MaterialComponents
或 Bridge
主题。
使用:
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar.Bridge">
<!-- ...... -->
<item name="materialCalendarStyle">@style/Widget.MaterialComponents.MaterialCalendar</item>
<item name="materialCalendarFullscreenTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar.Fullscreen</item>
<item name="materialCalendarTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar</item>
</style>
这是我单独用于material日历的样式,除了选择日期圈外一切都很完美
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@color/colorAppBackground</item>
<item name="android:actionMenuTextAppearance">@style/RobotoMenuText</item>
<item name="titleTextAppearance">@style/RobotoMenuText</item>
<item name="android:windowIsTranslucent">true</item>
<item name="titleTextStyle">@style/RobotoMenuText</item>
<item name="colorSurface">@color/colorAppGreen</item>
<item name="materialCalendarTheme">@style/CalenderTheme</item>
<item name="materialCalendarFullscreenTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar.Fullscreen</item>
<item name="materialCalendarStyle">@style/Widget.MaterialComponents.MaterialCalendar</item>
</style>
<style name="CalenderTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@color/colorAppBackground</item>
</style>
你 have to switch 从 Theme.AppCompat
到 Theme.MaterialComponents
或 Bridge
主题。
使用:
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar.Bridge">
<!-- ...... -->
<item name="materialCalendarStyle">@style/Widget.MaterialComponents.MaterialCalendar</item>
<item name="materialCalendarFullscreenTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar.Fullscreen</item>
<item name="materialCalendarTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar</item>
</style>