You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitProject1/doc/向金成——精读代码/layout/datetime_picker.xml

80 lines
3.3 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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