uialertcontroller

How to change font size and color of UIAlertAction in UIAlertController

左心房为你撑大大i 提交于 2019-12-19 04:14:58
问题 In the image above how to change the font size and color of "Done", "Some Other action"? and how to change the font size and color of "title", and "message"? Thank you. 回答1: This is from another stack overflow post but seems to work fine. Post found here. UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Dont care what goes here, since we're about to change below" message:@"" preferredStyle:UIAlertControllerStyleActionSheet]; NSMutableAttributedString *hogan = [

How to add UIImageView in UIAlertController?

蹲街弑〆低调 提交于 2019-12-18 16:45:49
问题 I want UIAlertController to present an alert with UIImageView in an ActionSheet . But when I run the application it is terminating. This is my code: UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Title" message:@"Welcome" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *okButton = [UIAlertAction actionWithTitle:OK style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { }]; [alert addAction:okButton]; UIImageView *imgv = [[UIImageView alloc

Show UIAlertController over keyboard

雨燕双飞 提交于 2019-12-18 11:09:21
问题 In iOS 8 and lower show a UIActionSheet when keyboard is presented will present the action sheet over the keyboard. With iOS 9 this is no longer the case. In my app we have a chat functionality and want the show a action over the keyboard. We used to use UIActionSheet which worked fine until iOS 8. In iOS 9 the action sheet is present behind the keyboard. I've tried both UIActionSheet and UIAlertController . What we want is a action sheet like in messages.app I've tried placing the action

UIAlertController - change size of text fields and add space between them

情到浓时终转凉″ 提交于 2019-12-18 08:33:28
问题 My alert looks like this: Is it possible to make inputs bigger and add space between them? Here is a snippet from my code. I tried changing the frame property of the second text field but it didn't help: let alert = UIAlertController(title: title, message: message, preferredStyle: .Alert) // Add the textfields alert.addTextFieldWithConfigurationHandler({ (textField) -> Void in textField.placeholder = "Vaše jméno" }) alert.addTextFieldWithConfigurationHandler({ (textField) -> Void in textField

“Please wait” dialog in iOS8

浪子不回头ぞ 提交于 2019-12-17 22:16:26
问题 I used to have a "Please wait" dialog in my app for long time. It was quite simple thing using UIActivityIndicatorView and adding it to UIAlertView . However iOS8 introduced UIAlertController . Is it possible to add anything to it to have similiar effect? Is there another way of doing such thing with iOS8? I have searched a lot of sites and still have no idea how it can be done with the new API. I would appreciate any answers - links to libs, tutorials etc., which could be helpful. Regards,

UIAlertView automatic newline gone in iOS8?

本小妞迷上赌 提交于 2019-12-17 20:39:43
问题 It appears that UIAlertView is not compatible with iOS8. I've just discovered that all my multiline UIAlertViews become truncated one-liners in iOS8 (for the message). In iOS7 they are displayed correctly with multilines. iOS7: iOS8: [[[UIAlertView alloc] initWithTitle:@"Namn saknas" message:@"Du måste fylla i ditt namn för att kommentera" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil] show]; I'm aware of that UIAlertController should be used in iOS8 and later and that

How can I change the height of UITextField in UIAlertController in Swift?

不羁岁月 提交于 2019-12-17 20:14:36
问题 I have added a UITextField in a UIAlertController . I want to change the height of the text field. I have tried this way: let alertController = UIAlertController(title: "Comments", message: "Write your comments here", preferredStyle: UIAlertControllerStyle.alert) alertController.addTextField { (textField : UITextField) -> Void in var frame: CGRect = textField.frame frame.size.height = 100 textField.frame = frame textField.placeholder = "comment" print(textField.frame.size.height) } let

UIAlertController handle dismiss upon click outside (IPad)

眉间皱痕 提交于 2019-12-17 18:17:59
问题 Previous to iOS8 we used the UIActionSheet for showing alert and now we need to use the UIAlertController. When we used the UIActionSheet we could easily handle situations where the user clicked outside the pop up (which means he want to cancel the operation) by comparing the clickedButtonAtIndex to the cancelButtonIndex - if the user indeed pressed outside the popup we got the cancel button index in this function. How can we handle these situations with the new UIAlertController? I tried to

Showing a UIPickerView with UIActionSheet in iOS8 not working

流过昼夜 提交于 2019-12-17 15:43:01
问题 Showing a UIPickerView with UIActionSheet in iOS8 not working The code works in iOS7 , however it is not working in iOS8 . I'm sure it is because UIActionSheet is deprecated in iOS8 and Apple recommends to use UIAlertController . However, how to do it in iOS8 ? I should use UIAlertController ? iOS7 : iOS8 : EDIT: My GitHub project solving the problem. 回答1: From the reference for UIActionSheet: UIActionSheet is not designed to be subclassed, nor should you add views to its hierarchy. If you

Get input value from TextField in iOS alert in Swift

自闭症网瘾萝莉.ら 提交于 2019-12-17 10:15:28
问题 I'm trying to make an alert message with input, and then get the value from the input. I've found many good tutorials how to make the input text field. but I can't get the value from the alert. 回答1: Updated for Swift 3 and above: //1. Create the alert controller. let alert = UIAlertController(title: "Some Title", message: "Enter a text", preferredStyle: .alert) //2. Add the text field. You can configure it however you need. alert.addTextField { (textField) in textField.text = "Some default