Android的对话框有两种:PopupWindow和AlertDialog区别
来源:互联网 发布:nginx websocket 编辑:程序博客网 时间:2024/05/21 07:14
摘要 Android的对话框有两种:PopupWindow和AlertDialog。它们的不同点在于: AlertDialog的位置固定,而PopupWindow的位置可以随意 AlertDialog是非阻塞线程的,而PopupWindow是阻塞线程的 PopupWindow的位置按照有无偏移分,可以分为偏移和无偏移两种;按照参照
Android的对话框有两种:PopupWindow和AlertDialog。它们的不同点在于:
AlertDialog的位置固定,而PopupWindow的位置可以随意
AlertDialog是非阻塞线程的,而PopupWindow是阻塞线程的
PopupWindow的位置按照有无偏移分,可以分为偏移和无偏移两种;按照参照物的不同,可以分为相对于某个控件(Anchor锚)和相对于父控件。具体如下
showAsDropDown(View anchor):相对某个控件的位置(正左下方),无偏移
showAsDropDown(View anchor, int xoff, int yoff):相对某个控件的位置,有偏移
showAtLocation(View parent, int gravity, int x, int y):相对于父控件的位置(例如正中央Gravity.CENTER,下方Gravity.BOTTOM等),可以设置偏移或无偏移
0 0
- Android的对话框有两种:PopupWindow和AlertDialog区别
- android PopupWindow和AlertDialog区别
- 【Android】AlertDialog PopupWindow对话框
- PopupWindow和AlertDialog的区别
- Android 对话框AlertDialog和AlertDialog.Builder两者的区别
- Android AlertDialog和PopupWindow使用和区别
- PopupWindow和AlertDialog区别
- PopupWindow和AlertDialog区别
- PopupWindow和AlertDialog区别
- PopupWindow和AlertDialog区别
- PopupWindow和AlertDialog区别
- PopupWindow和AlertDialog区别
- PopupWindow和AlertDialog的使用和区别
- Day16、PopupWindow弹出窗和其他AlertDialog的子对话框
- Android 对话框AlertDialog,PopupWindow使用大全
- 初学android 对话框时需要主要AlertDialog和AlertDialog.builder之间的区别
- AlertDialog 与 PopupWindow的 区别
- popupWindow的创建和与alertDialog的区别
- QDatetime和QLocale结合使用返回特定语言的关于星期几的字符串
- 记国庆前的一次码农受骗记
- jquery easy ui的Combobox的绑定 $.post +webservices
- 在服务器上 .netFramework2.0 环境下,如何能在不改变服务器设置下,让站点能够运行 AJAX 程序
- NAT学习笔记,内容整理自网络
- Android的对话框有两种:PopupWindow和AlertDialog区别
- ios uitextfield 常用 delegate
- 第7周项目1电阻串联
- Effective C++ 读书笔记 条款10:令operator=返回一个reference to *this
- ArrayList其实就那么一回事儿之源码浅析
- /etc/profile 的修改技巧
- YII2 在backend下 使用gii建立crud
- iOS dictionary的使用
- cocos2dx画连接任意两点的绳子【始终连接触摸点与屏幕中心】