【问题标题】:Is it possible to change the font size of the header in the Material Datepicker component on Android?是否可以在 Android 上更改 Material Datepicker 组件中标题的字体大小?
【发布时间】:2022-08-16 01:37:57
【问题描述】:

由于 Android 上的可访问性原因,我的团队希望我更改 Material Datepicker 标题的字体大小以使其更加可见。有可能吗?怎么做?

    标签: android xml kotlin materialdatepicker


    【解决方案1】:

    是的,您可以更改标题的大小。

    Material Date Picker 使用这个主题

     <style name="MaterialCalendarTheme" parent="ThemeOverlay.MaterialComponents.MaterialCalendar">
        <!-- just override the colors used in the default style -->
        <item name="colorOnPrimary">@color/white</item>
        <item name="colorPrimary">@color/spruce_valencia</item>
        <item name="materialCalendarHeaderTitle">@style/date_text_appearance</item>
    
    </style>
    
    <style name="date_text_appearance" parent="@style/TextAppearance.AppCompat">
        <item name="android:textSize">@dimen/text_xlarge_heading</item>
    </style>
    

    材料日历标题标题是什么诀窍和休息你可以改变使用字体大小属性来更改文本大小。

    有关材料日期选择器属性和布局的更多信息,您可以追溯到这里 google material repo.

    【讨论】:

    • 有效!多谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-19
    • 2016-06-20
    • 1970-01-01
    • 2021-01-20
    相关资源
    最近更新 更多