第一次使用日期選擇器
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_margin="5dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="請選擇日期"
android:gravity="center"/>
<DatePicker
android:id="@+id/date_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_gravity="center"></DatePicker>
</LinearLayout>
發(fā)現(xiàn)我的選擇器是這個樣子的

可是我需要的樣子是這個樣子的

問了群友,沒有直接得到答案。
最后還是百度到了結(jié)果。
在DatePicker加一句樣式控制就可以了。
android:theme="@android:style/Theme"
順便整理下android系統(tǒng)自帶的各種樣式
使用Android提供的Style和Theme:
Android平臺提供了大量的styles和themes,可以在android包中的R.style下找到,但是Android現(xiàn)在并未提供關(guān)于styles和themes的相關(guān)文檔說明,具體可以參考styles.xml源碼 和themes.xml源碼 ,掃了一下,描述的很清楚。