我正在尝试使用DatePicker或CalanderView创建calendarView。但是,我不能让它们显示星期一,星期二这样的日子。等等...就像常规日历一样。我可以在IDE中看到这些日子,但是当我在实际的平板电脑和手机中运行时看不到那些日子。我尝试使用日期选择器和calanderView。但他们都没有成功。我很抱歉堆栈溢出不允许我上传我的屏幕,因为我还没有任何声誉。所以我链接到我的scree短。
这是屏幕短片的链接 来自IDE:http://postimg.org/image/upmc2sa3j/ 来自电话:http://postimg.org/image/9m2rk678f/
以下是使用DatePicker
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="#ff46554b"
android:layout_width="match_parent"
android:layout_height="match_parent" android:weightSum="1">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_weight=".8"
android:weightSum="1"
android:layout_height="wrap_content">
<DatePicker
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:calendarViewShown="true"
android:spinnersShown="false"
android:showWeekNumber="false"
android:id="@+id/datePicker"
android:layout_gravity="center_horizontal" android:layout_weight="0.60"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_weight=".2"
android:weightSum="1"
android:layout_height="53dp">
<Button
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="cancel"
android:layout_weight=".5"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:background="@drawable/refreshbutton"
android:id="@+id/cancel"/>
<Button
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="select"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="@drawable/refreshbutton"
android:layout_weight=".5"
android:id="@+id/select"/>
</LinearLayout>
这是我的datePicker
<DatePicker
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:calendarViewShown="true"
android:spinnersShown="false"
android:id="@+id/datePicker"
android:layout_gravity="center_horizontal" android:layout_weight="0.60"/>
这是我的日历视图
<CalendarView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/calendarView"
android:layout_alignParentLeft="true"
andro`enter code here`id:layout_alignParentTop="true"
android:scrollbarStyle="insideOverlay"
android:layout_gravity="center_horizontal"
android:layout_weight="0.8"/>