前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >android开源框架SweetAlertDialog的使用

android开源框架SweetAlertDialog的使用

作者头像
黄林晴
发布2019-01-10 16:03:08
1.4K0
发布2019-01-10 16:03:08
举报
文章被收录于专栏:代码男人

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();

更多种类可自行尝试,谢谢大家的支持!

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2017年03月23日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档