uialertcontroller

UIAlertController change font color

安稳与你 提交于 2019-12-03 05:53:17
Here's my code that creates the UIAlertController // Create the alert controller var alertController = UIAlertController(title: "Are you sure you want to call \(self.number)?", message: "", preferredStyle: .Alert) // Create the actions var okAction = UIAlertAction(title: "Call", style: UIAlertActionStyle.Default) { UIAlertAction in var url:NSURL = NSURL(string: "tel://\(self.number)")! UIApplication.sharedApplication().openURL(url) } var cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel) { UIAlertAction in } // Add the actions alertController.addAction(okAction)

How to customize UIAlertController with UITableView or is there any default control available like this UI in Pages app?

醉酒当歌 提交于 2019-12-03 05:35:48
I would like to implement a UIAlertViewController like this (Reference: Pages and Keynote app): . I have implemented a custom tableview and presented the view by mimicking the UIAlertViewController . But I cannot achieve a similar UI as above. Is there any default controller available for this? -(void)share:(id)sender { [self setModalPresentationStyle:UIModalPresentationCurrentContext]; AlertViewController *renameCntrl = [self.storyboard instantiateViewControllerWithIdentifier:AlertTblViewidentifier]; renameCntrl.optionViewDelegate = self; renameCntrl.providesPresentationContextTransitionStyle

show UIAlertController outside of ViewController

為{幸葍}努か 提交于 2019-12-03 05:08:39
问题 I have trouble to display my UIAlertController because I'm trying to show it in a Class which is not an ViewController. I already tried adding it: var alertController = UIAlertController(title: "Title", message: "Message", preferredStyle: .Alert) UIApplication.sharedApplication().keyWindow?.rootViewController?.presentViewController(alertController, animated: true, completion: nil) Which is not working... I didn't find any solution that worked for me yet. 回答1: I wrote this extension over

Change Action sheet popover arrow in iOS8

三世轮回 提交于 2019-12-03 04:43:47
i'm using UIAlertController . But on iPad with iOS 8, actionSheet show with popover arrow. Any ideas to hide that arrow? Here is my code: UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"this is alert controller" message:@"yeah" preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel action") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { NSLog(@"Cancel action"); }]; UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @

UIAlertController background color iOS10

↘锁芯ラ 提交于 2019-12-03 03:47:20
Code that I wrote for iOS9, worked really well: UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Select source" message:nil preferredStyle:UIAlertControllerStyleActionSheet]; alert.view.backgroundColor = DARK_BLUE; alert.view.tintColor = NEON_GREEN; UIView *subview = alert.view.subviews.firstObject; UIView *alertContentView = subview.subviews.firstObject; alertContentView.backgroundColor = DARK_BLUE; alertContentView.layer.cornerRadius = 10; My point of view is that UIAlertController is inheriting from UIViewController , and UIViewController have property UIView that

iOS 8 Only Memory Leak with UIAlertController or UIActionSheet

匿名 (未验证) 提交于 2019-12-03 02:00:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm seeing a memory leak in iOS 8 in simulator when I do the following with UIActionSheet or UIAlertController. UIActionSheet uses UIAlertController in IOS 8 so the issues are related. showCameraAction gets called when a button is pressed. I've removed all of the content from the delegate method and still get the leak in the case shown below. Am I using UIActionSheet in some way that I shouldn't? I would appreciate any help in resolving this issue. The same code has no leaks with IOS 7 (in the simulator). -( IBAction )

UIAlertView Vs UIAlertController - no keyboard in iOS 8

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a old Xcode project that is targeted for iOS 6 and higher. I recently opened it up in Xcode 6 and ran in iPhone 6 simulator for iOS 8. When I tried this action UIAlertView* dialog = [[UIAlertView alloc] initWithTitle:@"Enter Folder Name" message:@"Keep it short and sweet" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; dialog.alertViewStyle = UIAlertViewStylePlainTextInput; dialog.tag = 400; [dialog show]; I get a pop-up window but when I click on the text field, no keyboard comes up. I googled and read that I

IOS8中,UIActiconSheet已被废弃,同时基于UIActionSheet自定义的也将无效果。

笑着哭i 提交于 2019-12-03 01:31:15
IOS8中,UIActiconSheet已被废弃,同时基于UIActionSheet自定义的也将无效果。 Apple将UIActionSheet和UIAlertView整合成一个接口UIAlertController。 原来的是一个view,展示在window视图之上。现在改成了controller,展示方式变成由当前的controller直接present出来。 下面看看具体的接口: UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"This is Title" message:@"This is message" preferredStyle:UIAlertControllerStyleAlert]; [alert addAction:[UIAlertAction actionWithTitle:@"Action 1 (Default Style)" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { NSLog(@"Action 1 Handler Called"); }]]; [alert addAction:[UIAlertAction actionWithTitle:@"Action 2

How to change UIAlertController button text colour in iOS9?

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: The question is similar to iOS 8 UIActivityViewController and UIAlertController button text color uses window's tintColor but in iOS 9. I have a UIAlertController and the dismiss button keeps white colour even I have tried to set [[ UIView appearanceWhenContainedIn :[ UIAlertController class ], nil ] setTintColor :[ UIColor blackColor ]]; UIAlertController * strongController = [ UIAlertController alertControllerWithTitle : title message : message preferredStyle : preferredStyle ]; strongController . view . tintColor = [ UIColor

Add image to alert view

筅森魡賤 提交于 2019-12-03 00:46:34
I have an alert view that pops up when the user press the add button. How do i add an image to the alert view? I added some code that i took reference from stack overflow. My save button is replaced with the image and the image appear to be in blue colour... Code for Alert View var alert = UIAlertController(title: "Spring Element \(springNumber)", message: "Add spring properties", preferredStyle: .Alert) let saveAction = UIAlertAction(title: "Save", style: .Default) { (action: UIAlertAction!) -> Void in let textField1 = alert.textFields![0] as UITextField self.txtField1.append(textField1.text)