简体   繁体   English

Android-在SDK级别23中描述了setFocusedMonthDateColor()和setUnfocusedMonthDateColor()

[英]Android - setFocusedMonthDateColor() and setUnfocusedMonthDateColor() are depricated in SDK level 23

setFocusedMonthDateColor() and setUnfocusedMonthDateColor() are depricated from SDK level 23 onward and here is the what Android Docs has to say about the attribute focusedMonthDateColor : 从SDK级别23开始对setFocusedMonthDateColor()setUnfocusedMonthDateColor()进行了描述,这是Android Docs关于属性focusedMonthDateColor

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name". 可以以“ @ [+] [package:] type:name”的形式引用另一个资源,或者以“?[package:] [type:] name”的形式引用主题属性。

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb". 可以是颜色值,形式为“ #rgb”,“#argb”,“#rrggbb”或“ #aarrggbb”。

Constant Value: 16843587 (0x01010343) 常量值:16843587(0x01010343)

What does that even mean? 那有什么意思? And how am I supposed to color the focused and unfocused months of CalendarView ? 我应该如何为CalendarView的重点和非重点月份着色?

A lot of methods in CalendarView have been deprecated in API 23. All of them show: API 23中已弃用CalendarView许多方法,所有方法都显示:

This method was deprecated in API level 23. API级别23中不推荐使用此方法。

No longer used by Material-style CalendarView. 材质样式的CalendarView不再使用。

It seems to me that those methods are mostly meant for customizing the colors of the view. 在我看来,这些方法主要用于自定义视图的颜色。 And I therfore think (read: don't know exactly) that they want you to use the - in Android 5 introduced - colorPrimary etc. items. 因此,我认为(阅读:不完全知道)他们希望您使用-在引入的Android 5中colorPrimary等项目。 For example, a selected month would probably get the colorAccent . 例如,选定的月份可能会获得colorAccent

Give it a try. 试试看。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM