【问题标题】:CalenderView In AndroidAndroid 中的日历视图
【发布时间】:2018-05-05 23:18:39
【问题描述】:

我需要在Android中开发一个CalenderView,应该类似于下面这样,

我需要的Calendar的输出

我已经用谷歌搜索并按照步骤操作,但没有得到确切的输出。

我附上了 XML 和 JAVA 代码 [这是我现在得到的输出。

这是java代码

【问题讨论】:

  • 请不要发布代码、XML 或 logcat 输出的屏幕截图。请将所有文本作为文本发布。
  • 好的,我下次会关注,目前正在学习中。所以,我已经发布了基本代码。
  • 我认为您必须选择任何日期,一切顺利。
  • 我只需要显示一个月,因为我已经附加了有问题的输出图像
  • 不是“下一次”。现在就做

标签: android calendar


【解决方案1】:

我刚刚找到了降低calendar 高度的唯一方法,这不是一个好方法,你可以使用Material Calendar View Library代替CalendarView。这个库比官方库有更多的定制。

用法

  1. 将 compile 'com.prolificinteractive:material-calendarview:1.4.3' 添加到您的依赖项中。
  2. MaterialCalendarView 添加到您的布局或视图层次结构中。
  3. 设置OnDateSelectedListener 或在需要时致电MaterialCalendarView.getSelectedDates()

Javadoc Available Here

示例:

<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_showOtherDates="all"
app:mcv_selectionColor="#00F"
/>

有关更多信息和定制,您可以关注CUSTOMIZATION_BUILDER

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多