我正在使用 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>
您所需要做的就是引用不同的样式,其中包括日期大小稍大的字体。我不太确定为什么你的程序不能使用 styles.xml 工作,因为它看起来是正确的。不过,我只是将其添加到日历的 XML 属性中。这很好,因为假设您只使用一个日历,因此它并不是真正低效。将此行添加到日历 XML 中:
android:dateTextAppearance="@android:style/TextAppearance.Large"
希望这对您有帮助!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)