随笔分类 - Android
摘要:本文采用一个简单的例子解释DatePickerDialog、和TimePickerDialog的使用方法。.XML文件内容如下<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" and
阅读全文
摘要:DatePickerDialog日期选择对话框,用于日期的设置。下面举一个简单的单击Button按钮调用日期选择对话框的实例。并给出两种触发按钮单击事件的方法。<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill
阅读全文
摘要:Android对话框 Dialog,其直接子类 AlertDialog. AlertDialog的直接子类: DatePickerDialog、TimePickerDialog、ProgressDialog对话框和菜单一样,都是由Activity统一管理的,我们只需要重新实现onCreateDialog(int id)回调方法,根据showDialog(int id)传进来的不同对话框id,初始化并返回相应的对话框。下面举一个功能简单的例子来说明 对话框的使用。<RelativeLayout xmlns:android="http://schemas.android.com/a
阅读全文
摘要:子菜单是可以被添加到其它菜单上的菜单,但是子菜单不能添加到子菜单上。通常,当需要有大量的菜单项需要显示时,利用子菜单进行分类是一个很好的方法main.xml<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="mat
阅读全文
摘要:ContextMenu是一种悬浮于主界面上的菜单。当注册到一个View对象上时,默认情况下可以长按View对象约2秒钟呼出上下文菜单。Context menus do not support item shortcuts and item icons:不支持快捷键和显示图标。To show a context menu on long click, most clients will want to callregisterForContextMenu(View) and override onCreateContextMenu(ContextMenu, View, ContextMenu.C
阅读全文
浙公网安备 33010602011771号