Android Material CalendarView 选定日期背景半径

huangapple 未分类评论48阅读模式
英文:

Android Material CalendarView Selected Date Background Radius

问题

你好,我目前正在使用 Material CalendarView 库进行工作。

https://github.com/prolificinteractive/material-calendarview

一切都正常运行,但我试图减小用户选择日期时出现的圆形背景的半径。

因为目前太大了:

[![enter image description here][1]][1]

[1]: https://i.stack.imgur.com/wUZSU.png

我的代码目前如下:

<com.prolificinteractive.materialcalendarview.MaterialCalendarView
    android:id="@+id/calendarView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/CalenderViewCustom"
    android:background="@color/colorWhite"
    app:mcv_weekDayTextAppearance="@style/CalenderViewWeekCustomText"
    app:mcv_headerTextAppearance="@style/CalenderViewHeaderCustomText"
    android:dateTextAppearance="@style/CalenderViewDateCustomText"
    android:weekDayTextAppearance="@style/CalenderViewWeekCustomText">
</com.prolificinteractive.materialcalendarview.MaterialCalendarView>

styles.xml:

<style name="CalenderViewCustom" parent="Theme.AppCompat">
    <item name="colorAccent">@color/mainSelectedColor</item>
    <item name="android:headerYearTextAppearance">@color/colorBlack</item>
    <item name="android:headerMonthTextAppearance">@color/colorBlack</item>
    <item name="android:headerDayOfMonthTextAppearance">@color/colorBlack</item>
</style>

<style name="CalenderViewDateCustomText" parent="android:TextAppearance.DeviceDefault.Small">
    <item name="android:textColor">@color/colorBlack</item>
</style>

<style name="CalenderViewWeekCustomText" parent="android:TextAppearance.DeviceDefault.Small">
    <item name="android:textColor">@color/colorBlack</item>
</style>

<style name="CalenderViewHeaderCustomText" parent="android:TextAppearance.DeviceDefault.Small">
    <item name="android:textColor">@color/colorBlack</item>
</style>

是否有人知道解决方法?
英文:

Hi there I'm currently working with the Material CalendarView Library

https://github.com/prolificinteractive/material-calendarview

Everything is working fine but I'm trying to reduce the radius of the round background which is appearing when a User selects a date.

Because this is way too big:

Android Material CalendarView 选定日期背景半径

My code currently looks like this:

&lt;com.prolificinteractive.materialcalendarview.MaterialCalendarView
    android:id=&quot;@+id/calendarView&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;wrap_content&quot;
    android:theme=&quot;@style/CalenderViewCustom&quot;
    android:background=&quot;@color/colorWhite&quot;
    app:mcv_weekDayTextAppearance=&quot;@style/CalenderViewWeekCustomText&quot;
    app:mcv_headerTextAppearance=&quot;@style/CalenderViewHeaderCustomText&quot;
    android:dateTextAppearance=&quot;@style/CalenderViewDateCustomText&quot;
    android:weekDayTextAppearance=&quot;@style/CalenderViewWeekCustomText&quot;&gt;
&lt;/com.prolificinteractive.materialcalendarview.MaterialCalendarView&gt;

styles.xml:

 &lt;style name=&quot;CalenderViewCustom&quot; parent=&quot;Theme.AppCompat&quot;&gt;s
    &lt;item name=&quot;colorAccent&quot;&gt;@color/mainSelectedColor&lt;/item&gt;
    &lt;item name=&quot;android:headerYearTextAppearance&quot;&gt;@color/colorBlack&lt;/item&gt;
    &lt;item name=&quot;android:headerMonthTextAppearance&quot;&gt;@color/colorBlack&lt;/item&gt;
    &lt;item name=&quot;android:headerDayOfMonthTextAppearance&quot;&gt;@color/colorBlack&lt;/item&gt;

&lt;/style&gt;

&lt;style name=&quot;CalenderViewDateCustomText&quot; parent=&quot;android:TextAppearance.DeviceDefault.Small&quot;&gt;
    &lt;item name=&quot;android:textColor&quot;&gt;@color/colorBlack&lt;/item&gt;

&lt;/style&gt;

&lt;style name=&quot;CalenderViewWeekCustomText&quot; parent=&quot;android:TextAppearance.DeviceDefault.Small&quot;&gt;
    &lt;item name=&quot;android:textColor&quot;&gt;@color/colorBlack&lt;/item&gt;
&lt;/style&gt;


&lt;style name=&quot;CalenderViewHeaderCustomText&quot; parent=&quot;android:TextAppearance.DeviceDefault.Small&quot;&gt;
    &lt;item name=&quot;android:textColor&quot;&gt;@color/colorBlack&lt;/item&gt;
&lt;/style&gt;

Does anyone know a solution for this ?

huangapple
  • 本文由 发表于 2020年5月3日 19:43:13
  • 转载请务必保留本文链接:https://java.coder-hub.com/61573865.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定