我有一个日历应该在有事件的日期上显示小点。我正在使用一个可绘制的对象来绘制这些小点。
这在我的安卓6.0的Nexus设备上运行得很好,但是如果我在安装了5.0的设备上尝试它,它就不起作用了。小点会填满整个容器。
附上了错误截图。两个大蓝色圆圈应该是4像素的小点。
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="center_horizontal|center_vertical">
<shape android:shape="oval">
<size android:height="4dp" android:width="4dp" />
<solid android:color="@color/blue"/>
</shape>
</item>
</layer-list>
我将像这样调用此可绘制对象("@drawable/date_default_event_stroke"是上面的代码):
<selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:caldroid="http://schemas.android.com/apk/res-auto">
<item android:drawable="@drawable/date_default_event_stroke" android:state_pressed="false" />
</selector>