Android calendarview font size

非 Y 不嫁゛ 提交于 2019-12-24 04:31:33

问题


I am using xamarin for building android application this is my first app. I have a calendarview I need to change the font size and style of the day. I tried the below code the font color changed but the size is too small. minimum api level 11 target 16. I am using galaxy note 2 for testing

<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>

回答1:


All you need to do is reference a different style that includes a slightly bigger font for the size of the date. I'm not exactly sure why yours isn't working using the styles.xml as it seems correct. However I would just simply add it to the XML attributes for the calendar. This will be fine as presumably you're only using one Calendar and therefore it isn't really inefficient. Add this line to the calendar XML:

android:dateTextAppearance="@android:style/TextAppearance.Large"

Hope this helps you!




回答2:


You should change "android:dateTextAppearance", you can check this reference too ;) CalendarView

also you can try this

Style will save the world!



来源:https://stackoverflow.com/questions/16412549/android-calendarview-font-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!