Open duanwencheng opened 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>
`
要放入ScrollView中得先给CalendarLayout设置一个高度,ScrollView里面的内容默认都是自适应高度,会导致高度不正常,其次事件冲突解决一下即可
`<?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">
`