对话框或弹出自定义样式的3种方法
来源:互联网 发布:黄伟文十大经典知乎 编辑:程序博客网 时间:2024/06/05 22:42
GitHub博客:http://lioil.win/2016/07/14/Dialog-PopupWindow.html
Coding博客:http://c.lioil.win/2016/07/14/Dialog-PopupWindow.html
1、使用Activity实现
在AndroidManifest.xml中修改Actity的主题android:theme="@style/MyDialogStyleBottom" <style name="MyDialogStyleBottom"> (注意不要继承系统Dialog主题, 否则对话框match_parent无效以致对话框与屏幕边缘有缝隙) <!--无标题--> <item name="android:windowNoTitle">true</item> <!--背景透明--> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowIsTranslucent">true</item> <!--背景变暗--> <item name="android:backgroundDimEnabled">true</item> </style>
2、使用Dialog实现
View view = View.inflate(···自定义对话框布局···); Dialog dialog = new Dialog(···R.style.MyDialogStyleBottom···); (MyDialogStyleBottom不要继承系统Dialog主题) dialog.setContentView(view); dialog.show();
3、使用PopupWindow实现
View view = View.inflate(···自定义对话框布局···); PopupWindow p = new PopupWindow(view,···); p.set背景··· p.setLoaction···或p.setDropdown···(设置显示位置);
0 0
- 对话框或弹出自定义样式的3种方法
- Android自定义样式的对话框
- 自定义对话框样式的Activity
- Android自定义样式的对话框
- 打开网页自动弹出QQ对话框的3种方法
- 三种弹出对话框的方法
- iOS8底部弹出日期选择或自定义选择器的方法
- .net 弹出对话框的方法
- PHP弹出对话框的方法
- 【android学习】自定义的Builder弹出对话框
- 自定义spinner的下拉弹出窗口样式
- Xamarin.iOS 自定义样式的弹出窗
- 自定义 Android 对话框 (AlertDialog) 的样式
- 自定义 Android 对话框 (AlertDialog) 的样式
- 自定义 Android 对话框 (AlertDialog) 的样式
- 自定义 Android 对话框 (AlertDialog) 的样式
- 自定义 Android 对话框 (AlertDialog) 的样式
- 自定义 Android 对话框 (AlertDialog) 的样式
- PHP fsockopen 异步调用接口在nginx上偶尔实效的情况
- POJ 2226 Muddy Fields 笔记
- 1217
- Android移动端性能测试
- sqoop远程debug讲解
- 对话框或弹出自定义样式的3种方法
- canvas画布之》》》》》》打飞机游戏
- BotZone的Pacman2
- frameset 使用
- printf 函数的实现 *
- all about mac tool install
- Matlab 数值计算小示例。主要为牛顿迭代法、LU分解法、拉格朗日插值、牛顿插值法
- 【第一篇】Naza-lite入门需要知道的一些常识
- MatConvNet--VL_NNBILIEARSAMPLER