Android(安卓)菜单和对话框等
16lz
2021-01-26
三种菜单: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:需要用到Notification和NotificationManager
主要用在后台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官网
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:需要用到Notification和NotificationManager
主要用在后台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官网
更多相关文章
- Android(安卓)- base - SQLite
- Android(安卓)Input(一)-相关模块初始化
- Android文件操作说明
- [Android]DrawerLayout中Toolbar遮挡问题
- android顶部导航条
- android之onCreateOptionsMenu失效,按菜单键无反应
- Android(安卓)数据库一次创建多个表
- android 官方文档阅读记录-多屏幕适配
- 菜单项选项