huanghaibin-dev / CalendarView

Android上一个优雅、万能自定义UI、仿iOS、支持垂直、水平方向切换、支持周视图、自定义周起始、性能高效的日历控件,支持热插拔实现的UI定制!支持标记、自定义颜色、农历、自定义月视图各种显示模式等。Canvas绘制,速度快、占用内存低,你真的想不到日历居然还可以如此优雅!An elegant, highly customized and high-performance Calendar Widget on Android.
Apache License 2.0
9.05k stars 1.78k forks source link

android x版本放到ScrollView中会导致ScrollView无法滑动,support版本可以 #562

Open duanwencheng opened 4 years ago

duanwencheng commented 4 years ago

`<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <com.haibin.calendarview.CalendarLayout
            android:id="@+id/calendarLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            app:calendar_content_view_id="@+id/ll_content_view"
            app:calendar_show_mode="only_week_view"
            app:default_status="shrink">

            <com.haibin.calendarview.CalendarView
                android:id="@+id/calendarView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#fff"
                app:calendar_padding="0dp"
                app:current_month_lunar_text_color="#CFCFCF"
                app:current_month_text_color="#333333"
                app:max_year="2025"
                app:min_year="2006"
                app:month_view="com.eviapp.intl.view.ProgressMonthView"
                app:month_view_show_mode="mode_fix"
                app:other_month_lunar_text_color="#e1e1e1"
                app:other_month_text_color="#e1e1e1"
                app:scheme_text="假"
                app:scheme_text_color="#333"
                app:scheme_theme_color="#128c4b"
                app:selected_lunar_text_color="@color/md_white"
                app:selected_text_color="@color/md_white"
                app:selected_theme_color="#EEFF2800"
                app:week_background="#fff"
                app:week_start_with="sun"
                app:week_text_color="#111111"
                app:week_view="com.eviapp.intl.view.ProgressWeekView"
                app:week_view_scrollable="true"
                app:year_view_day_text_color="#333333"
                app:year_view_day_text_size="9sp"
                app:year_view_month_text_color="#ff0000"
                app:year_view_month_text_size="20sp"
                app:year_view_scheme_color="#f17706" />

            <LinearLayout
                ...
            </LinearLayout>
        </com.haibin.calendarview.CalendarLayout>
    </LinearLayout>
</ScrollView>

`

huanghaibin-dev commented 4 years ago

要放入ScrollView中得先给CalendarLayout设置一个高度,ScrollView里面的内容默认都是自适应高度,会导致高度不正常,其次事件冲突解决一下即可