我有一个片段,其中包含日历,文本视图和列表视图。所有这些视图都在滚动视图中。我需要在布局中做两件事。
当我向上滑动时如何滚动以调用滚动视图,我想隐藏日历和文本视图。然后向下滑动。它显示了整个布局。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:animateLayoutChanges="true"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:layout_below="@+id/rel"
android:id="@+id/scroll"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/compactcalendar_view_container"
android:layout_below="@+id/rel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="New Text"
android:textColor="#e1dcdc"
android:background="#011627"
android:id="@+id/date_picker_text_view"
android:textAlignment="center" />
<com.github.sundeepk.compactcalendarview.CompactCalendarView
android:id="@+id/cvCalendar"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="250dp"
app:compactCalendarTargetHeight="250dp"
android:layout_below="@+id/textView14"
app:compactCalendarBackgroundColor="#011627"
app:compactCalendarCurrentDayBackgroundColor="#FFC107"
app:compactCalendarCurrentSelectedDayBackgroundColor="#939393"
app:compactCalendarTextColor="#e1dcdc"
app:compactCalendarTextSize="12sp" />
</LinearLayout>
<ListView
android:id="@+id/lvList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#e9e9e9"
android:dividerHeight="10dp"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:scrollbars="none"
android:background="#eee"
android:layout_below="@+id/scroll"
android:layout_centerHorizontal="true" />
</LinearLayout>
</ScrollView>
</RelativeLayout>