uialertview

Swift: UIAlert in function - Use of unresolved identifier 'present'

£可爱£侵袭症+ 提交于 2021-02-05 10:52:27
问题 I'm trying to limit the show of code so I just want to call function containing two strings to create a uialert faster with 1 line instead of 5/ The error I'm getting Use of unresolved identifier 'present' at the line present(alert, animated: true, completion: nil) // Controlling Alerts for Errors func showAlert(titleString: String, messageString: String) { // Alert to go to Settings let alert = UIAlertController(title: titleString, message: messageString, preferredStyle: .alert) alert

Why is ActivityViewController displaying auto constraint errors in console?

穿精又带淫゛_ 提交于 2020-06-29 11:35:16
问题 I'm trying to implement a share button in my application and so naturally, I turned to UIActivityViewController . For some reason, any time I press the share button and it pops up, I get the following message in my log: Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or

“Renders with edge antialiasing” causes delay in UIAlertView in iOS 7

有些话、适合烂在心里 提交于 2020-05-10 04:16:29
问题 Ever since iOS 7, I noticed my UIAlertViews show with a sort of drawing delay- what happens is the screen dims and the UIAlertView's text appears on the screen for just a split second before the actual frame of the alert view appears. I traced the problem to being due to the "Renders with edge antialiasing" flag set to YES in my application plist file. Turning this off solves the problem (but then I have ugly jaggies on any rotated views, which is what I was using that flag to solve in the

自定义的UIAlertView在IOS7中需要注意的问题

时间秒杀一切 提交于 2020-02-27 03:51:56
在IOS7之前,我们更改系统的UIAlertView,以实现自己想要的效果: #pragma mark -- UIAlertViewDelegate //实现代理增加网络指示器 - (void)willPresentAlertView:(UIAlertView *)alertView{ indicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; indicator.frame = CGRectMake(110, 20, 50, 50); [alertView addSubview:indicator]; [indicator startAnimating]; [indicator release]; } 而 在iOS7上不允许我们更改系统的UIAlertView,自己添加的控件将不再显示了。 解决方法: 可以采用UIWindow的方式实现,网上有很多具体的做法,就不再描述了。 来源: https://www.cnblogs.com/417460188dy/p/3336384.html

UIAlertView 弹框

一笑奈何 提交于 2020-02-27 03:50:39
UIAlertView 1.Title 获取或设置UIAlertView上的标题。 2.Message 获取或设置UIAlertView上的消息 UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title" message:@"message" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; alertView.title = @"T"; alertView.message = @"M"; [alertView show]; 3.numberOfButtons (只读) 返回UIAlertView上有多少按钮. UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title" message:@"message" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; NSLog(@"%d",alertView.numberOfButtons); [alertView show]; 4.cancelButtonIndex UIAlertView *alert = [

简述UIAlertView的属性和用法

孤街浪徒 提交于 2020-02-27 03:49:43
1.Title 获取或设置UIAlertView上的标题。 2.Message 获取或设置UIAlertView上的消息 UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title" message:@"message" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; alertView.title = @"T"; alertView.message = @"M"; [alertView show]; 3.numberOfButtons (只读) 返回UIAlertView上有多少按钮. UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title" message:@"message" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; NSLog(@"%d",alertView.numberOfButtons); [alertView show]; 4.cancelButtonIndex UIAlertView *alert = [[UIAlertView

给iOS开发新手送点福利,简述UIAlertView的属性和用法

拥有回忆 提交于 2020-02-27 03:48:50
转载自: http://www.cnblogs.com/xmqios/p/3477461.html UIAlertView 1.Title 获取或设置UIAlertView上的标题。 2.Message 获取或设置UIAlertView上的消息 UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title" message:@"message" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; alertView.title = @"T"; alertView.message = @"M"; [alertView show]; 3.numberOfButtons (只读) 返回UIAlertView上有多少按钮. UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title" message:@"message" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; NSLog(@"%d",alertView.numberOfButtons); [alertView

三十而立,从零开始学ios开发(七):Delegate,Action Sheet, Alert

时间秒杀一切 提交于 2020-02-27 03:48:11
Action Sheet和Alert是2种特殊的控件(暂且称之为控件吧,其实不是控件真正的控件,而是ios中的2个类,这2个类定义了2种不同类型的用于和用户交互的弹出框),Action Sheet是从底部弹出,上面有2个或者2个以上的选项供用户选择,Alert就是一个警告框,上面有1个或者1个以上的按钮供用户进行选择。 在继续这一篇的内容之前,稍微花点时间说一下ios中用到的Delegate Pattern(委托\代理模式)。 ios中有很多已经定义好的类可以供我们在编写程序时直接使用,例如UIActionSheet、UIAlertView等,这些类定义了很多method,我们可以调用这些method且不必知道这些method是如何实现的。但是有一个问题,如果我们想改变这些method的实现,那我们该这么做呢?一种方法是继承,我们可以继承一个类,然后在自己的类中重新写method,这是一个方法,但不是一个很方便的方法,有时候你仅仅需要改变很小的一个功能,却要继承一个很大的类,貌似有点复杂了,而且如果你需要一些不同的实现,那你就需要定义好多不同的类,这会很麻烦。为了使开发过程更加的方便,ios使用了另一种方法来达到同样的目的,就是使用delegate,我们使用一个已定义的类,然后使用委托\代理来改写类中的method,程序在运行时

ios - tableView

隐身守侯 提交于 2020-02-21 23:53:20
有关于UIAlertView,警告框控件 示例: 1 UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"用户未登录" 2 message:@"请登录后查看消费统计信息" 3 delegate:self 4 cancelButtonTitle:@"确定" 5 otherButtonTitles:nil]; 参数含义:initWithTitle:初始化标题      message:显示通知的内容      delegate:委托对象      cancelButtonTitle:取消按钮标题      otherButtonTitles:其他按钮标题 来源: https://www.cnblogs.com/chupeng/p/3956266.html

Reachability的使用

我的梦境 提交于 2020-02-05 02:28:18
刚到一家新公司 做新项目 关于网络状态的监听和同事产生了不一样的看法 原来我的网络监听都是自己写的 后来发现自己不是一般的傻 有一个叫做Reachability的东西 很简单 很实用 很暴力 下面就是使用方法 首先在AppDelegate.h添加头文件"Reachability.h",导入框架SystemConfiguration.frame 下面是代码: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //开启网络状况的监听 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:kReachabilityChangedNotification object:nil]; self.hostReach = [Reachability reachabilityWithHostName:@"www.baidu.com"] ; //开始监听,会启动一个run loop [self.hostReach startNotifier]; } -(void