Android的calendarview字体大小 [英] Android calendarview font size

查看:1976
本文介绍了Android的calendarview字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用xamarin构建Android应用程序,这是我的第一个应用程序。我有一个calendarview我需要改变一天的字体大小和样式。我想下面的code中的字体颜色改变,但规模太小。最低API级别11目标16.我使用GALAXY NOTE 2测试

 <样式名称=Widget.CalendarView.Custom父=@安卓风格/ Widget.CalendarView>
<项目名称=机器人:focusedMonthDateColor> @彩色/灰度和LT; /项目>
<项目名称=机器人:weekDayTextAppearance> @android:风格/ TextAppearance.Medium< /项目>
<项目名称=机器人:dateTextAppearance?>机器人:ATTR / textAppearanceLarge< /项目>
<项目名称=机器人:selectedWeekBackgroundColor> @android:彩色/透明< /项目>
< /风格>


解决方案

所有你需要做的是参考不同的风格,其中包括对日期的尺寸稍微大一点的字体。我不知道是什么原因你没有使用styles.xml,因为它似乎是正确的工作。不过,我想只是简单地将其添加到日历中的XML属性。这将是罚款,你只使用一个日历,因此它是不是真的低效presumably。该行添加到日历XML:

 的android:dateTextAppearance =@安卓风格/ TextAppearance.Large

希望这可以帮助您!

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>

解决方案

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!

这篇关于Android的calendarview字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆