MaterailDesign风格的日历,MaterailCalendarView

   日历控件有很多,但是如果要实现在日历上标注文字或者图片,该如何实现呢,小菜鸟一枚,下面写写我在项目里用到的一个控件--MaterialCalendarView, 基于MaterailDesign风格De日历,据说最早是由外国人写的,然后开源出来了,之所以会选中这个是他可以较方便的在日历上添加标记,而且MaterailDesign风格的很受大家好评,做项目的时候网上找了好些资料,也找了发过类似帖子的大神支援。好了下面是我的项目的demo跟效果图


这个是我项目中一个模块的截图,下面那部分日历就是效果图啦。

1.布局文件

<com.prolificinteractive.materialcalendarview.MaterialCalendarView
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/calendarView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:mcv_tileSize="45dp"
            app:mcv_dateTextAppearance="@style/dateTextAppeararent"
            app:mcv_weekDayTextAppearance="@style/monthTextAppeararent"
            app:mcv_headerTextAppearance="@style/headerTextAppeararent"
            app:mcv_weekDayLabels="@array/custom_myweekdays"
            app:mcv_monthLabels="@array/custom_mymonths"
            android:layout_alignParentTop="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true" />

可以以添加类库的方式导入,但是最好是以导入类库的方式导入AS,这样有了源代码你就可以根据你自己的需要更改UI或者源代码了,在这里就不提供github的第三方库下载地址了,直接去github上搜 MaterialCalendarView就有了。

仅提供那两个array/custom_myweekdays 和 array/custom_mymonths写在Strings.xml里,剩下的在类库里都有了

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值