Android 日历视图水平线消失
我创建了一个带有日历视图的活动。上下滚动时,有时其中一条灰色水平线消失。请参见下图,了解我正在谈论的行。这是什么原因 view_calendar.xmlAndroid 日历视图水平线消失,android,calendarview,Android,Calendarview,我创建了一个带有日历视图的活动。上下滚动时,有时其中一条灰色水平线消失。请参见下图,了解我正在谈论的行。这是什么原因 view_calendar.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<CalendarView
android:id="@+id/calendar"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
在你的“日历”中,一条消失的灰线表明你在那一排。在那条消失的线中,有一块显示了指向当前日期的灰色。就像在你的“日历”中,那块22
。您可以在下面链接中提供的图像中看到
在xml中尝试此代码-
<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" >
<CalendarView
android:id="@+id/calendar"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
我添加了自己拍摄的新截图。看看第7周和第8周之间的情况。为什么不试试上面链接中提供的代码来找到这个问题?也许你使用的是相对布局,这就是你面临问题的原因。尝试线性布局而不是相对布局。它不起作用。这是日历视图的某种缺陷吗?我注意到只有当我向上滚动时才会发生这种情况。我更新了xml代码。将此代码替换为您的。希望它能起作用。
<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" >
<CalendarView
android:id="@+id/calendar"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>