首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏全栈程序员必看

    它们的定义UIAlertView

    这里,我就展示一个自己定义的UIAlertView效果控件,视图出现的时候动画-先放大-再缩小-最后成正常比例,消失的时候缩小加渐隐.调用也非常方便,不须要像系统先创建后,我在类内部就已经写好了,仅仅须要

    1.1K30编辑于 2022-07-06
  • 来自专栏Elton的技术分享博客

    创建没有按钮的UIAlertView

    默认的,UIAlertView都有一个或者多个按钮,如果你想创建没有按钮的UIAlertView,可以使用以下的方法: UIAlertView *alert; ... alert = [[[UIAlertView alloc] initWithTitle:@"Configuring PreferencesnPlease Wait..." 上面的标题可能有些靠上,可以用过给标题增加回车的方式,使标题居中: UIAlertView *alert; ... 如果你还想给UIAlertView添加一个等待提示符,则可以这么做: UIAlertView *alert; ... 解除UIAlertView的显示 因为这个AlertView没有按钮,所以就不能通过点击按钮将这个提示框去掉。可以通过程序的方式,将这个窗口关掉。

    1.9K20发布于 2021-01-26
  • 来自专栏TechBox

    UIAlertView、UIActionSheet、UIAlertController使用

    (一)UIAlertView 1.默认样式 // UIAlertView iOS8开始 被废弃 - (void)defaultAlert { // iOS8被废弃 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"测试" delegate:self cancelButtonTitle:@"取消" plainTextAlert.gif 3.带有密文输入框 - (void)secureText { // iOS8被废弃 UIAlertView *alert = [[UIAlertView 旨在替代UIAlertView和UIActionSheet这两个控件。 我们知道,使用UIAlertView和UIActionSheet需要遵守对应的协议并实现相应的方法,因为UIAlertView和UIActionSheet采用delegate的方式处理事件。

    6.6K30发布于 2018-06-05
  • 来自专栏ios2020

    iOS UIAlertView 的基本使用方法

    来源:https://www.oschina.net/question/54100_36098 UIAlertView常用于应用界面信息警告提示。 创建和显示UIAlertView 下面显示一个带有“取消”和“确定”两个按钮的的UIAlertView提示对话框。 下面显示一个带有“取消”和“确定”两个按钮的的UIAlertView提示对话框。 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示信息" 要接收UIAlertView的按钮事件,则得要在类中处理UIAlertViewDelegate。

    1.9K30发布于 2020-06-04
  • 来自专栏一“技”之长

    IOS UIAlertView(警告框)方法总结

    IOS中UIAlertView(警告框)常用方法总结 一、初始化方法 - (instancetype)initWithTitle:(NSString *)title message:(NSString  * alert = [[UIAlertView alloc]initWithTitle:@"我的警告框" message:@"这是一个警告框" delegate:self cancelButtonTitle *)alertView; 已经展现警告框时触发的方法 - (void)didPresentAlertView:(UIAlertView *)alertView; 警告框将要消失时触发的方法 - (void )alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex; 警告框已经消失时触发的方法 - (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView; 专注技术,热爱生活,交流技术,也做朋友。

    1.3K10发布于 2018-08-15
  • 来自专栏移动端开发

    Swift 2.0 UIAlertView 和 UIActionSheet 的使用

     在 IOS 9.0 之后, UIAlertView  是 给废弃了的,虽然你要使用的话,暂时还是可以的,但是在 9.0 之后,IOS 推荐大家使用的是  UIAlertController 这个控制器 // 在 IOS 9.0 之后, UIAlertView 是 给废弃了的,虽然你要使用的话,暂时还是可以的,但是在 9.0 之后,IOS 推荐大家使用的是 UIAlertController 这个控制器

    1K90发布于 2018-01-09
  • 来自专栏韩曙亮的移动开发专栏

    【IOS 开发】基本 UI 控件详解 (UISegmentedControl | UIImageView | UIProgressView | UISlider | UIAlertView )

    警告框控件 (UIAlertView) 1. 警告框控件 (UIAlertView) 简介 (1) UIAlertView 创建流程 UIAlertView 创建流程 :  -- 创建 UIAlertView : 创建时指定 标题, 内容 , 按钮等信息, 按钮监听需要创建 UIAlertView 的 UIAlertViewDelegate 委托对象; -- 显示 UIAlertView : 调用显示 UIAlertView 的显示方法; 简单的对话框示例 (1) 创建 UIAlertView API 创建方法 :  [[UIAlertView alloc] initWithTitle:<#(NSString *)#> message 控件, 传入参数 标题 内容 委托对象 取消按钮 其它按钮 */ UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@

    4.7K40编辑于 2023-03-27
  • 来自专栏陈满iOS

    iOS·长按保存图片到相册:系统原生UIActionSheet与UIAlertView,UIAlertController等方案

    error) { message =@"成功保存到相册"; UIAlertView*alert = [[UIAlertView alloc *alert = [[UIAlertView alloc]initWithTitle:@"提示"message:message delegate:self cancelButtonTitle:@"确定" , UIAlertViewDelegate > 修改点2:VC添加两个属性 @property (nonatomic , strong) UIAlertView *myAlertView; @property ]; } } 修改点4:实现UIAlertViewDelegate代理方法 #pragma - mark - UIAlertViewDelegate - (void)alertView:(UIAlertView UIAlertView的代码 修改点1:longPressAction方法的实现 -(void)longPressAction:(UILongPressGestureRecognizer*)gesture

    2.2K10发布于 2018-09-10
  • 来自专栏全栈程序员必看

    iOS 四种延时的方法[通俗易懂]

    *alert=[[UIAlertView alloc]initWithTitle:@”” message:@”GCD延时” delegate:self cancelButtonTitle:@”确定” [NSThread sleepForTimeInterval:11.0f]; [self delayMethod3]; } – (void)delayMethod{ UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@”” message:@”PerformSelector延时” delegate:self cancelButtonTitle :@”确定” otherButtonTitles:@”取消”, nil]; ; } – (void)delayMethod2{ UIAlertView *alert=[[UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@”” message:@”NSThread延时” delegate:self cancelButtonTitle:@

    2.2K10编辑于 2022-07-08
  • 来自专栏iOS122-移动混合开发研究院

    BlocksKit初见:一个支持将delegate转换成block的Cocoa库

    NSTimer、NSarray、NSDictionary、NSSet、NSIndexSet、NSMutableArray等 DynamicDelegate:动态代理(消息转发机制) UIKit:扩展了 UIAlertView ,UIActionView,UIButton 等 最常用的是 UIKit Category,它为 UIAlertView,UIActionSheet,UIButton,UITapGestureRecognizer 用法实例 UIAlertView 和 UIActionSheet 用法示例: UIAlertView *alertView = [[UIAlertView alloc] bk_initWithTitle handler:nil]; [alertView bk_addButtonWithTitle:@"确定" handler:nil]; [alertView bk_setDidDismissBlock:^(UIAlertViewUIAlertView为例,UIAlertView在运行时动态关联了A2DynamicUIAlertViewDelegate @implementation UIAlertView (BlocksKit

    1.6K100发布于 2018-01-02
  • 来自专栏腾讯Bugly的专栏

    【团队分享】手机QQ:升级iOS8.3后,发图就崩,为哪般?

    但正所谓“福无双至,祸不单行”,我们继续深入一些隐蔽场景测试,又发现两个必现崩溃的场景: 编辑图片后选择取消 关闭Wi-Fi后发送短视频 分析对比后,发现这两个场景有一个共同的业务逻辑,即是弹出UIAlertView 所以,我们开始怀疑是否在iOS8.3系统中,是不是所有调用UIAlertView的地方都会发生崩溃? 但在选择了几个调用UIAlertView的界面进行验证后,发现并没有崩溃发生。 于是,我们得到一个解决此类崩溃问题的方法: 将工程中所有调用UIAlertView执行UI提示的逻辑全部替换为调用SimpleAlertView执行,当然,还需根据不同的场景修改适配UI样式和交互表现。 我们在工程中搜索UIAlertView的调用,发现竟有500+的调用,分别分布在300+的文件中,如果替换的话,其潜在风险和工作量都要仔细考量,而且还需针对不同场景修改UI样式和交互表现,不可取! 在前面的验证过程中,我们发现并非所有出现UIAlertView的界面都发生了崩溃,而是只有三个场景出现此类问题,而且都和图片选择器有关,于是把焦点又转移到图片选择器相关的逻辑,并进行了一系列的检查和验证

    1.5K40发布于 2018-03-22
  • 来自专栏落影的专栏

    一个BUG的发现、定位和解决

    弹出提示是用的UIAlertView的方式。在键盘出现时弹出UIAlertView的提示,键盘会收起,UIAlertView消失后,键盘会再次弹出,是一次正常的表现。 2、问题复现 按照复现路径做一次尝试,发现BUG可以复现,确定问题存在; 根据经验,猜测问题可能出现在键盘和UIAlertView上,与“禁言”的业务无关。 在直播间内尝试其他非“禁言”的场景,同样是在键盘出现的时候,弹出UIAlertView的提示,也会造成后续键盘无法弹出的情况。 对于UIAlertView的iOS 11系统行为,猜测: 1、在UIAlertView弹出的时候,会抢占系统的keyWindow,所以会出现键盘在UIAlertView的时候收回(因为keyWindow 改变); 2、在UIAlertView消失的时候,会遍历所有Window,找到其中z轴最高作为keyWindow,所以会出现键盘在UIAlertView消失后弹出(keyWindow变成原来的);

    1.8K70发布于 2018-04-27
  • 来自专栏陈满iOS

    iOS开发·runtime原理与实践: 关联对象篇(Associated Object)(应用场景:为分类添加“属性”,为UI控件关联事件Block体,为了不重复获得某种数据)

    关联对象:为UI控件关联事件Block体 3.1 UIAlertView 开发iOS时经常用到UIAlertView类,该类提供了一种标准视图,可向用户展示警告信息。 要是能在创建UIAlertView的时候直接把处理每个按钮的逻辑都写好,那就简单多了。这可以通过关联对象来做。 方案2:关联Block体 除了上一个方案中的传统方法,我们可以利用关联对象为UIAlertView关联一个Block:首先在创建UIAlertView的时候设置关联一个回调(objc_setAssociatedObject Test2ViewController.m #pragma mark - way2 - (void)popAlertViews2 { UIAlertView *alert = [[UIAlertView @end UIAlertView+Handle.m #import "UIAlertView+Handle.h" #import <objc/runtime.h> @implementation UIAlertView

    3.5K21发布于 2018-09-10
  • 来自专栏大师级码师

    iOS发送短信的代码

    #pragma mark -发送短信 @interface ViewController () { UIAlertView *mfAlertview;//定义一个弹出框 viewControllers] lastObject] navigationItem] setTitle:@"发送短信"];//修改短信界面标题 } else { UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"抱歉" message:@"短信功能不可用!" break; case MessageComposeResultFailed://发送短信失败 { mfAlertview=[[UIAlertView break; case MessageComposeResultSent: { mfAlertview=[[UIAlertView

    5.7K00发布于 2021-09-19
  • 来自专栏云原生布道专栏

    【IOS开发基础系列】UIAlertController专题

    1 UIAlertView         随着苹果上次iOS 5的发布,对话框视图样式出现在了我们面前,直到现在它都没有发生过很大的变化。 Objective-C版本: UIAlertView *alertview = [[UIAlertView alloc] initWithTitle: @"标题" message: @"这个是UIAlertView var alertView = UIAlertView(title: "标题", message: "这个是UIAlertView的默认样式", delegate: self, cancelButtonTitle UIAlertView文本对话框 UIAlertView密码对话框 UIAlertView登录对话框         UIAlertViewDelegate 为了实现原来我们在创建UIAlertView时创建的按钮效果,我们只需创建这两个动作按钮并将它们添加到控制器上即可。     

    2.7K30编辑于 2023-10-16
  • 来自专栏好派笔记

    iOS发送短信的代码

    #pragma mark -发送短信 @interface ViewController () { UIAlertView *mfAlertview;//定义一个弹出框 viewControllers] lastObject] navigationItem] setTitle:@"发送短信"];//修改短信界面标题 } else { UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"抱歉" message:@"短信功能不可用!" break; case MessageComposeResultFailed://发送短信失败 { mfAlertview=[[UIAlertView break; case MessageComposeResultSent: { mfAlertview=[[UIAlertView

    6.2K30发布于 2021-10-29
  • 来自专栏梧雨北辰的开发录

    iOS相机、麦克风等权限的判断与设置

    case AVAuthorizationStatusDenied:{ //提示跳转到相机设置(这里使用了blockits的弹窗方法) UIAlertView *alert = [UIAlertView bk_showAlertViewWithTitle:@"相机授权" message:@"跳转相机授权设置" cancelButtonTitle:@"取消" otherButtonTitles:@[@"设置"] handler:^(UIAlertView *alertView, NSInteger buttonIndex) { *alert = [UIAlertView bk_showAlertViewWithTitle:@"相册授权" message:@"跳转相册授权设置" cancelButtonTitle:@"取消" otherButtonTitles:@[@"设置"] handler:^(UIAlertView *alertView, NSInteger buttonIndex) {

    4.3K60发布于 2018-04-24
  • 来自专栏freesan44

    ios实战-runloop实现的同步弹窗

    我们知道UIAlertView使用delegate返回数据实现的,使用麻烦,之前介绍过用Block实现的例子《ios实战-使用Block的UIAlertView》 今天介绍使用runloop实现,用return button { [button.superview removeFromSuperview]; _selectBtnIndex =1; _bModel =NO; } ok,没有问题,假如你想使用系统自带的UIAlertView 的话,也是一样的,只是不要在程序刚启动的时候调用,不然会无法弹出(原因暂时还不知道),下面是UIAlertView的例子: - (NSInteger)doModal { [selfshowAlert NSDefaultRunLoopModebeforeDate:[NSDatedistantFuture]]; }return_selectBtnIndex; } - (void)showAlert {UIAlertView selfcancelButtonTitle:@"cancel"otherButtonTitles:@"ok",nil]; [alertView show]; } - (void)alertView:(UIAlertView

    71920发布于 2018-09-05
  • 来自专栏APP自动化测试

    函数响应式编程及ReactiveObjC学习笔记 (二)

    我用UIAlertView给大家举个例子, 虽然苹果已经不推荐用这个 不过我们拿来当例子用用看 先写一个常规的AlertView #import "ViewController.h" #import < UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"RAC" message:@"RAC Delegate Test" delegate UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"RAC" message:@"RAC Delegate Test" delegate *alertView = [[UIAlertView alloc] initWithTitle:@"RAC" message:@"RAC Delegate Test" delegate:self cancelButtonTitle x.last); }]; [alertView show]; 结果为: 2017-07-23 16:29:26.089 RAC[68525:13409884] first: <UIAlertView

    71111发布于 2019-10-15
  • 来自专栏陈满iOS

    iOS开发·第三方数据库处理框架:Realm 基本用法

    /增 - (IBAction)onAdd:(id)sender { if (_nameTF.text.length ==0 || _ageTF.text.length == 0) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Empty" [_realm beginWriteTransaction]; [_realm addObject:s]; [_realm commitWriteTransaction]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Sucess" *alert = [[UIAlertView alloc] initWithTitle:@"Empty"

    1.4K20发布于 2018-09-10
领券