打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
两个非常不错的自定义UIAlertView第三方类库

UIAlertView大家都不陌生了。UIAlertView不可以添加控件,比如说:UILabel、UITextView等等,所以遇到这个需求,一般都要自定义UIAlertView来解决。

我再github上找到了两个非常错的自定义UIAlertView第三方类库,分别是:LMAlertView和CustomIOSAlertView。

LMAlertView使用简介

LMAlertView ( https://github.com/lmcd/LMAlertView ) 在github上有610个star。说明这个第三方的UIAlertView还不错,我大概看了一下用法也比较简单。

来看看两个个案例效果:



用CocoaPods安装LMAlertView

pod 'LMAlertView'

使用案例

LMAlertView *alertView = [[LMAlertView alloc] initWithTitle:@"iOSDevTip"message:@"关注一下"delegate:nilcancelButtonTitle:@"ok"otherButtonTitles:nil];// Add your subviews here to customiseUIView *contentView = alertView.contentView;[alertView show];    

LMAlertView还保持着UIAlertView的创建方法,作者还比较用心。

CustomIOSAlertView使用简介

CustomIOSAlertView ( https://github.com/wimagguc/ios-custom-alertview )比LMAlertView的star还多一些,有861个。同样我们先看一下效果:


用CocoaPods安装CustomIOSAlertView

pod 'CustomIOSAlertView', '~> 0.9.3'

使用案例

CustomIOSAlertView *alertView = [[CustomIOSAlertView alloc] init];    UIView *customView ..;[alertView setContainerView:customView];[alertView show];

CustomIOSAlertView可以设置代理,还可以通过block来实现按钮的点击事件。功能相对比较齐全。

喜欢的童鞋可以star一下,以备不时之需。如果你觉得不错,记得分享给更多朋友哈,谢谢!

【今日微信公号推荐↓】


 

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
关于自定义AlertView背景的方法收集
【IOS】自定义UIAlertView样式,实现可替换背景和按钮
iOS 8之后使用黑色键盘与UIAlertVIew 的冲突
iOS获取当前app版本
IOS开源库一览表
UIAlertController UIAlertAction (UIAlertView, UIActionSheet)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服