简单的警告对话框
来源:互联网 发布:中国服装出口数据 编辑:程序博客网 时间:2024/05/16 09:57
1.布局文件
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="250dp" android:layout_height="wrap_content" android:layout_gravity="center" android:background="@drawable/application_white_icon" android:gravity="center" android:orientation="vertical" > <TextView android:layout_width="match_parent" android:layout_height="35dp" android:gravity="center" android:text="亲,你办理入住后才可以使用!" android:textColor="#8f8f8f" android:textSize="16sp" /> <ImageView android:layout_width="match_parent" android:layout_height="2dp" android:layout_marginTop="8dp" android:background="@drawable/application_pressed_darkblue_default_green_selector" /> <TextView android:id="@+id/addsuccesstext" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="10dp" android:gravity="right" android:text="\n知道了\n" android:textColor="#8f8f8f" android:textSize="22sp" /></LinearLayout>
2.values文件夹里面的sytle.xml文件
<!-- Dialog对话框的样式 --> <style name="CustomDialogTheme" parent="@android:style/Theme.Dialog"> <item name="android:windowIsFloating">true</item> <item name="android:windowNoTitle">true</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> <item name="android:fitsSystemWindows">true</item> </style>
3.弹出警告对话框的方法
/** * 弹出警告话框 */ public void popupAlertDialog() { // 自定义是否退出程序的对话框 final Dialog alertdialog = new Dialog(mContext, R.style.CustomDialogTheme); alertdialog.getWindow(); alertdialog.requestWindowFeature(Window.FEATURE_NO_TITLE); alertdialog.setContentView(R.layout.application_dialog_exit_application); alertdialog.setCancelable(false); alertdialog.show();// 弹出对话框 Handler mHandler = new Handler(); mHandler.postDelayed(new Runnable() { @Override public void run() { alertdialog.dismiss(); } }, ConstantsMember.AGAIN_CONTROL_SWITCH_TIME); }
0 0
- 简单的警告对话框
- 警告对话框AlertDialog的使用
- android 删除的警告对话框
- Alertialog警告对话框的用法
- 警告对话框
- 警告对话框
- 警告对话框
- 警告对话框
- AlertDialog:警告对话框的创建方法
- ios 简单的音频警告
- ArcMap – 启动对话框、地理坐标系警告对话框、许可到期提示对话框的关闭与开启
- android中的dialog 警告对话框,选择对话框,和一些自定义的对话框
- 对话框的简单使用
- 简单的对话框
- 简单的对话框
- 简单的swing对话框
- 简单的对话框格式
- 最简单的对话框
- Eclipse安装颜色主题插件eclipse color theme
- python学习(二):函数
- Mac 10.12.1 安装cocoapods(淘宝镜像用不了的)
- 广域网详解
- RelativeLayout相对布局
- 简单的警告对话框
- hdu1237简单计算器(栈的简单运用)
- Codeforces 653E (BFS set)
- 统一建模语言UML
- Lua 中使用面向对象(续)--newproxy生成userdata使用__gc
- 老鼠尝毒药问题
- 华信ppt演讲
- minSdk(API 23,N preview ) != deviceSdk(API 23)
- 《Head First设计模式》学习笔记之策略模式