当前位置: 代码迷 >> Android >> Android 菜单跟对话框等
  详细解决方案

Android 菜单跟对话框等

热度:76   发布时间:2016-05-01 17:10:03.0
Android 菜单和对话框等
三种菜单:Options Menu、Context Menu、Submenu
Context Menu:长按启动,多用于ListView,Items in a context menu do not support icons or shortcut keys.
Submenu:子菜单不能创建子菜单,换句话说,菜单最多只能有2级

Action Bar:3.0开始的版本,主要是用于代替传统的标题栏,Options Menu也在这里显示了

对话框,都继承自Dialog类
AlertDialog:需要用到AlertDialog.Builder,可以创建不只是Yes/No式样的dialog,如List式
ProgressDialog:进度条式样的dialog
DatePickerDialog&TimePickerDialog:可供用户选择日期时间的dialog

Toast:a message that pops up on the surface of the window.可以被Service创建,不能接受事件处理

Status Bar Notification:需要用到NotificationNotificationManager
主要用在后台Service通知用户一个事件,如果是当前的Activity需要通知功能应该使用Dialog代替

A style is a collection of properties that specify the look and format for a View or window.
A theme is a style applied to an entire Activity or application, rather than an individual View.

参看Android Developers官网
  相关解决方案