android开源框架SweetAlertDialog的使用
来源:互联网 发布:淘宝设计店铺 编辑:程序博客网 时间:2024/06/06 02:24
SweetAlertDialog是一种android炫酷的开源框架,相比普通的dialog要美观的许多。
我们要使用开源项目SweetAlertDialog作为Library,首先我们将开源项目导入,新建自己的项目,将开源项目作为自己的Library(方法略)。开源项目地址:http://pan.baidu.com/s/1b9LYPo
1.简单的消息提示效果图如下:
代码:
SweetAlertDialog sweetAlertDialog=new SweetAlertDialog(this);
sweetAlertDialog.setCancelable(true);
sweetAlertDialog.setTitleText("这是一个简单的消息提示框");
sweetAlertDialog.setCanceledOnTouchOutside(true);
sweetAlertDialog.show();
2.错误提示框,效果如下:
代码:
SweetAlertDialog alertDialog=new SweetAlertDialog(this, SweetAlertDialog.ERROR_TYPE);
alertDialog.setTitleText("登录失败");
alertDialog.setContentText("用户名或密码错误").show();
3.成功提示框,效果如下:
代码:
new SweetAlertDialog(this, SweetAlertDialog.SUCCESS_TYPE)
.setTitleText("支付成功")
.setContentText("等待商家接单...").show();
更多种类可自行尝试,谢谢大家的支持!
- android开源框架SweetAlertDialog的使用
- 炫酷开源框架 SweetAlertDialog
- SweetAlertDialog
- SweetAlertDialog
- android 开源框架nostra13的使用
- Android开源框架--ViewPagerIndicator的使用
- Android开源框架--ViewPagerIndicator的使用
- Android开源框架Volley的使用
- android---Afinal开源框架的使用
- Android 开源框架ViewPageIndicator的使用
- Android 开源框架Logger的使用
- Android开源框架Glide的使用
- android开源框架-----Picasso框架的使用
- Android开源框架—android Gson的使用
- Android实践 -- Android开源框架Glide的使用
- Android开源框架的SlidingFragment的使用
- Android第三方开源对话消息提示框:SweetAlertDialog
- 关于SweetAlertDialog在Android Studio中遇到问题
- shell脚本之传递参数(三)
- file_put_contents() failed to open stream: Permission denied 问题解决(生成日志文件)
- es6 学习笔记(一)箭头函数
- perl 获取铜板街页码
- error C2039: “string”: 不是“std”的成员解决方案
- android开源框架SweetAlertDialog的使用
- DFA(判断是否是数字)
- Java备忘录//28--33
- magento 更新所有商品属性,提交只能保存1000个
- JSP基础知识
- 2016年不可错过的21个深度学习视频、教程和课程
- jenkins 一键式部署
- uC/OS-III 学习笔记 (X)
- JodaTime时间处理工具使用详解