第一次使用日期选择器
<?xml version="1.0" encoding="utf-8"?>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_margin="5dp">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="请选择日期"
android:gravity="center"/>
android:id="@+id/date_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_gravity="center">

发现我的选择器是这个样子的

QQ图片20170724121250.png
可是我需要的样子是这个样子的

QQ图片20170724121842.png

问了群友,没有直接得到答案。
最后还是百度到了结果。
在DatePicker加一句样式控制就可以了。
android:theme="@android:style/Theme"

顺便整理下android系统自带的各种样式
使用Android提供的Style和Theme:
Android平台提供了大量的styles和themes,可以在android包中的R.style下找到,但是Android现在并未提供关于styles和themes的相关文档说明,具体可以参考styles.xml源码 和themes.xml源码 ,扫了一下,描述的很清楚。

更多相关文章

  1. Android基础————UI布局之UI美化分解详解
  2. SeekBar自定义样式最优实现
  3. android设置系统语言,字体大小,字体样式导致widget控件失效
  4. Android(安卓)提供的一系列辅助系统开发工具
  5. android 1.5 NDK发布
  6. Android(安卓)Button 样式 圆角
  7. Android中实现全屏、无标题栏的两种办法(另附Android系统自带样式
  8. Android(安卓)基础总结:(一)Android系统架构
  9. android ListView 样式 item样式,条目样式

随机推荐

  1. reactnative ~ android 模块通讯混合跳转
  2. Android API中文文档TextView
  3. J2ME项目移植到Android平台六大注意事项
  4. android LinearLayout和RelativeLayout实
  5. 浅析android平板市场的今天。
  6. Android中的APK,TASK,PROCESS,USERID之间
  7. Android(安卓)Bitmap 缩放 旋转 水印 裁
  8. nexus7 升级失败后手动刷系统
  9. Android 下使用 JSON 实现 HTTP 请求(自
  10. Android 中对JSON数据解析实例代码