爬坑小王子——Android Studio集成漂亮Sweet Alert Dialog

本文介绍SweetAlertDialog的集成步骤与配置方法,帮助读者快速掌握并应用到Android项目中。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

作为一个专门坑蒙拐骗的程序员,你必须拥有一颗爬坑的心态,不然你别想在网络的世界里生存下去。当然了,像我这样的坑货写这篇文章只是为了记录下

Sweet Alert Dialog

的集成和使用
至于原因吗?很简单,就是怕以后忘记了或者说可以快捷的使用它。当然了感谢大神提供的框架。看完了你就真的了,这个还是蛮好集成的。废话不多说了,现在就开始吧!Go Go Go github:点击打开链接

第一步:
你不需要去GitHub上下载什么jar,Dome的了,因为Google已经为我们做好了准备好了的。
复制: sweetalert:library:1.3 打开你的Android Studio 然后





恭喜你,到这里你就已经将SweetAlertDialog 集成到你的项目中了,但是,当AS build完后,你会发现,TM的居然报错了。没关系,这不是才第一步吗,俗话说得好,事不过三吗?
第二步:

修改AndroidManifest.xml:

在manifest添加 xmlns:tools=”http://schemas.android.com/tools”

在application添加 tools:replace=”android:icon,android:theme,android:allowBackup,android:label,android:supportsRtl”

将在application中所用到的全部android:都在上面tools:replace=添加进去,逗号分隔。

如下:


<?xml version= "1.0" encoding= "utf-8" ?>
<manifest xmlns:android= "http://schemas.android.com/apk/res/android"
package = "cn.cgrs.myalert" >
<application
tools:replace= "android:allowBackup,android:icon,android:label,android:supportsRtl,android:theme"
android:allowBackup= "true"
android:icon= "@mipmap/ic_launcher"
android:label= "@string/app_name"
android:supportsRtl= "true"
android:theme= "@style/AppTheme" >
<activity android:name= ".MainActivity" >
<intent-filter>
<action android:name= "android.intent.action.MAIN" />
<category android:name= "android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>


没错,就这样完了,漂亮飘逸的提示信息就出来了!至于效果如何,我就不演示了!谁用谁做的。。。。

菜B一枚,请轻喷。。。



评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值