|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
you may not use this file except in compliance with the License.
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
See the License for the specific language governing permissions and
|
|
|
limitations under the License.
|
|
|
-->
|
|
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
|
android:orientation="horizontal"
|
|
|
android:layout_gravity="center_horizontal"
|
|
|
android:layout_width="wrap_content"
|
|
|
android:layout_height="wrap_content">
|
|
|
<!--
|
|
|
1、声明了一个线性布局,方向为水平,相对于父组件的对齐方式是 水平居中
|
|
|
2、指定了布局的宽高,尺寸都适配内容
|
|
|
-->
|
|
|
|
|
|
<NumberPicker
|
|
|
android:id="@+id/date"
|
|
|
android:layout_width="120dip"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:focusable="true"
|
|
|
android:focusableInTouchMode="true"
|
|
|
/>
|
|
|
<!--
|
|
|
1、NumberPicker为数值选择器,声明了一个数组选择器,id为date
|
|
|
2、指定了宽为恒定的大小120dip,高度是自适应的,适配内容
|
|
|
3、android:focusable属性 指定了该组件是否可以通过物理操作获取焦点即物理键盘,同一时间只能有一个控件能获得焦点,焦点控件能对消息进行响应处理,
|
|
|
当前为true,可以获得焦点
|
|
|
4、android:focusableInTouchMode属性 指定了该控件能否通过触摸方式获得焦点,当前真。
|
|
|
-->
|
|
|
|
|
|
<NumberPicker
|
|
|
android:id="@+id/hour"
|
|
|
android:layout_width="50dip"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:layout_marginLeft="5dip"
|
|
|
android:focusable="true"
|
|
|
android:focusableInTouchMode="true"
|
|
|
/><!--
|
|
|
1、声明了一个数值选择器,id为hour
|
|
|
2、宽为50dip,高适配内容,左外边距5dip
|
|
|
3、focusable属性为真,则能通过物理操作方式,使该控件获得焦点
|
|
|
4、focusableInTouchMode属性为真 控件能通过触摸方式获得焦点
|
|
|
-->
|
|
|
|
|
|
<NumberPicker
|
|
|
android:id="@+id/minute"
|
|
|
android:layout_width="50dip"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:layout_marginLeft="5dip"
|
|
|
android:focusable="true"
|
|
|
android:focusableInTouchMode="true"
|
|
|
/><!--
|
|
|
1、声明了一个数值选择器,id为minute
|
|
|
2、宽50dip,高适配内容,左外边距5dip
|
|
|
3、可以通过物理方式,触摸方式获得焦点
|
|
|
-->
|
|
|
|
|
|
<NumberPicker
|
|
|
android:id="@+id/amPm"
|
|
|
android:layout_width="50dip"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:layout_marginLeft="5dip"
|
|
|
android:focusable="true"
|
|
|
android:focusableInTouchMode="true"
|
|
|
/><!--
|
|
|
1、声明了一个数值选择器,id为amPm
|
|
|
2、宽50dip,高适配内容,左外边距5dip
|
|
|
3、可以通过物理方式,触摸方式获得焦点
|
|
|
-->
|
|
|
</LinearLayout> |