您的位置:首页 > 其它

安卓开发_时间、日期选择器的简单使用

2013-08-17 23:10 309 查看
这里介绍两个控件来简单实现日期,时间的功能

两个控件都只要在xml文件中添加一下即可

一、AnalogClock控件

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

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AnalogClock组件"
android:textSize="18dp"
android:paddingTop="10dp"
android:layout_gravity="center"
/>
<AnalogClock
android:id="@+id/analogClock1"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_height="wrap_content" />

</LinearLayout>


二、DialogClock控件

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<DigitalClock
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="DiaitalClock"
android:id="@+id/id_clock_digitalclock"
android:textSize="30dp"
android:gravity="center"
android:textColor="#ff0000"
/>

</RelativeLayout>


效果图:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐