uialertcontroller

UITextField in UIAlertController (border, backgroundColor)

感情迁移 提交于 2019-12-17 09:47:55
问题 Here is a screenshot of a UIAlertController . I was just playing around custom fonts and textfield properties but I was unable to accomplish the following: clear background of the UITextField no ugly border (black box) as shown below As I dived more into the code and iOS runtime headers, I was able to modify border and background color but the above issue still remains as those properties belong to a container UITextView . Changing background to clearColor doesn't help. Has anybody ever

Is there any way to add UIPickerView into UIAlertController (Alert or ActionSheet) in Swift?

时光毁灭记忆、已成空白 提交于 2019-12-17 09:22:15
问题 I'm totally new to swift (and iOS programming at all), but I started messing around with it (it wasn't a good idea when everything is still beta version :D). So I tried to figure it out by myself, but still nothing. Even tried to add subview containing picker without any success. So can any one help me? 回答1: Well this is my final code which worked for me. It is a mix by a few ideas. The main reasons that I will accept my answer is that my code is in Swift, my code uses UIAlertController, my

Is there any way to add UIPickerView into UIAlertController (Alert or ActionSheet) in Swift?

自闭症网瘾萝莉.ら 提交于 2019-12-17 09:22:13
问题 I'm totally new to swift (and iOS programming at all), but I started messing around with it (it wasn't a good idea when everything is still beta version :D). So I tried to figure it out by myself, but still nothing. Even tried to add subview containing picker without any success. So can any one help me? 回答1: Well this is my final code which worked for me. It is a mix by a few ideas. The main reasons that I will accept my answer is that my code is in Swift, my code uses UIAlertController, my

Is there any way to add UIPickerView into UIAlertController (Alert or ActionSheet) in Swift?

南笙酒味 提交于 2019-12-17 09:22:09
问题 I'm totally new to swift (and iOS programming at all), but I started messing around with it (it wasn't a good idea when everything is still beta version :D). So I tried to figure it out by myself, but still nothing. Even tried to add subview containing picker without any success. So can any one help me? 回答1: Well this is my final code which worked for me. It is a mix by a few ideas. The main reasons that I will accept my answer is that my code is in Swift, my code uses UIAlertController, my

How to change the background color of the UIAlertController?

元气小坏坏 提交于 2019-12-17 07:21:59
问题 Due to strange behavior of UIActionSheet in iOS 8, I have implemented UIAlertController with UIAction as buttons in it. I would like to change the entire background of the UIAlertController. But I can't find any ways to do it. Tried even with, actionController.view.backgroundColor = [UIColor blackColor]; But didn't help me out. Any inputs on this regard will be appreciable. Thanks in advance. 回答1: You have to step some views deeper: let subview = actionController.view.subviews.first! as

Swift - UIAlert with image

流过昼夜 提交于 2019-12-13 22:27:10
问题 I have this code: var zdjecieGlowne: UIImage? = nil let alert = UIAlertController(title:"MyTitle", message: "My Message Box ", preferredStyle: UIAlertControllerStyle.alert) let saveAction = UIAlertAction(title: "MyTitle", style: .default, handler: nil) //saveAction.setValue(UIImage(named: "logo")?.withRenderingMode(UIImageRenderingMode.alwaysOriginal), forKey: "image") saveAction.setValue(zdjecieGlowne, forKey: "image") dump(zdjecieGlowne) alert.addAction(saveAction) alert.addAction

How to remove the outer border of UITextField presented in UIAlertActionController

末鹿安然 提交于 2019-12-13 22:17:20
问题 I am adding multiple UITextFields to my alert controller, and I don't want that ugly black box around them. I know it's not the border property of the textField, because I have tried setting that and that influences the actual textField, not the box. I have tried textField.superview?.backgroundColor = UIColor.redColor() textField.superview?.layer.borderColor = UIColor.redColor().CGColor Setting the background Color works as expected, filling in the space between the textfield and the "black

iOS 8 Swift sending user directly to location services from an Alert dialog

放肆的年华 提交于 2019-12-13 18:23:35
问题 When a user has location services turned off, I want to prompt to turn them on with a UIAlertController. One of the options in the Alert Controller should take them directly to location services (for the OS, not the app). Right now, I've gotten as far as being able to send the user to permissions for my specific app, but not for the overall OS location settings. Is there a way to send the user directly to the OS Location settings from the UIAlertController? Here is the current code (located

How to add UITableview in UIAlertController in iOS8?

陌路散爱 提交于 2019-12-13 15:00:34
问题 Till iOS7 in Custom view we can put tableview in alert as per below picture. But in iOS8 UITableview is not working. I can put it in tableview but the tableview is not scrolling and not detecting any click on any cell. So, how do I implement this type of AlertController ? 回答1: Please try below code with custom view and animations Test.h #import <UIKit/UIKit.h> @interface Test : UIView <UITableViewDataSource,UITableViewDelegate> { UITableView *table; } - (id)initWithFrame:(CGRect)frame Array:

Objective C - I would like UIAlertController to not be removed when button clicked

不打扰是莪最后的温柔 提交于 2019-12-13 13:00:25
问题 I would like to present a UIAlertController with 2 buttons. One button should close the alert and the second should perform an action but remain the alert on screen. Is there some configuration that can be done to action that it won't close the alert? UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"title" message:@"message" preferredStyle:UIAlertControllerStyleAlert]; [alert addAction:[UIAlertAction actionWithTitle:@"Do Something" style:UIAlertActionStyleDefault