私はRecyclerView
の中に別のタイプの4つの異なるカードを表示しています。そのカードの1つが、このライブラリWeekViewからカレンダーのカスタム表示を示しています。私のビューをスクロールし始め、カレンダー・カードが画面の境界から外に出てくるまで、すべてのことがわかります。カスタムの週ビューには、cardviewが正しいスクロールしているが、独自の週ビューが起こっている見ることができるように画像セル内のAndroidカスタムビュー
に示した上記の効果を引き起こし、ツールバー層の上に描かれているように見えますツールバーレイヤの上に表示されます。私Adapter
で
私は私のViewHolder
calendarView = (WeekView) itemView.findViewById(R.id.todayView);
if (calendarView != null) {
initializeCalendarView(calendarView);
}
private void initializeCalendarView(WeekView mWeekView) {
mWeekView.setOnEventClickListener(this);
mWeekView.setMonthChangeListener(this);
mWeekView.setEventLongPressListener(this);
mWeekView.setEmptyViewLongPressListener(this);
setupDateTimeInterpreter(false, mWeekView);
mWeekView.goToToday();
mWeekView.setColumnGap((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, context.getResources().getDisplayMetrics()));
mWeekView.setTextSize((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 12, context.getResources().getDisplayMetrics()));
mWeekView.setEventTextSize((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 12, context.getResources().getDisplayMetrics()));
}
でWeekView
を初期化し、これが私のCardView
<android.support.v7.widget.CardView
android:id="@+id/doctorDashboardCalendar"
android:layout_width="match_parent"
android:layout_height="800dp"
android:layout_margin="@dimen/margin10"
app:cardCornerRadius="3dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:background="#e0e0e0">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/notes_icon_dark"
android:layout_margin="10dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/text18"
android:fontFamily="@string/font_name_2"
android:text="Calendar"/>
</LinearLayout>
<*************************.WeekView
android:id="@+id/todayView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="true"
app:eventTextColor="@android:color/white"
app:textSize="12sp"
app:hourHeight="30dp"
app:headerColumnPadding="4dp"
app:headerColumnTextColor="@color/toolbar_text"
app:headerRowPadding="6dp"
app:columnGap="4dp"
app:noOfVisibleDays="1"
app:headerRowBackgroundColor="@color/toolbar"
app:dayBackgroundColor="#05000000"
app:todayBackgroundColor="@color/white"
app:headerColumnBackground="#ffffffff"
app:todayHeaderTextColor="@color/accent"
app:showNowLine="true"
app:nowLineColor="@color/colorAccent"
app:enableScrolling="false"/>
</LinearLayout>
</android.support.v7.widget.CardView>
万一、チャイルドクリップをオフにしましたか?それが私が通常そういうものを見る唯一の方法です。 –