Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/198.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 日历视图水平线消失_Android_Calendarview - Fatal编程技术网

Android 日历视图水平线消失

Android 日历视图水平线消失,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" > <

我创建了一个带有日历视图的活动。上下滚动时,有时其中一条灰色水平线消失。请参见下图,了解我正在谈论的行。这是什么原因

view_calendar.xml

<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>