當我將日期選擇器添加到我的活動中時。它被正確添加。它的日期和月份部分是正確的,但是,年份部分正在顯示日曆。我也收到此錯誤 -Android中的日期選擇器看起來不太好
The following classes could not be found:
- CalendarView (Change to android.widget.CalendarView, Fix Build Path, Edit XML)
- DatePicker (Change to android.widget.DatePicker, Fix Build Path, Edit 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"
tools:context=".MainActivity" >
<DatePicker
android:id="@+id/datePicker1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
這屆我收到輸出(請忽略體積圖像)。
我想將它添加到我的應用程序,這樣我可以輸入出生的來自用戶的日期。但由於年份(日曆),它看起來不太好。
可能是什麼問題?請幫忙。
發佈您的整個XML佈局。什麼是您的最低SDK? – Sam
@Sam - API 8 Android 2.2 –
[This question and answer](http://stackoverflow.com/q/11365959/1267661)可能會有所幫助。 – Sam