Android 日历视图字体大小

A.A*_*ada 3 android monodevelop xamarin

我正在使用 Xamarin 构建 android 应用程序,这是我的第一个应用程序。我有一个CalendarView我需要更改当天的字体大小和样式。

我尝试了下面的代码,字体颜色改变了,但尺寸太小了。最低 API 级别为 11,目标 API 级别为 16。我使用 Galaxy Note 2 进行测试。

<style name="Widget.CalendarView.Custom" parent="@android:style/Widget.CalendarView">
    <item name="android:focusedMonthDateColor">@color/gray</item>      
    <item name="android:weekDayTextAppearance">@android:style/TextAppearance.Medium</item>
    <item name="android:dateTextAppearance">?android:attr/textAppearanceLarge</item>
    <item name="android:selectedWeekBackgroundColor">@android:color/transparent</item>
</style>
Run Code Online (Sandbox Code Playgroud)

edw*_*ard 5

您需要做的就是引用不同的样式,其中包含与日期大小相对应的稍大字体。我不确定为什么你的不工作使用styles.xml,因为它看起来是正确的。但是,我只是简单地将它添加到日历的 XML 属性中。这会很好,因为大概你只使用一个日历,因此它并不是真的低效。将此行添加到日历 XML:

android:dateTextAppearance="@android:style/TextAppearance.Large"
Run Code Online (Sandbox Code Playgroud)

希望这对你有帮助!