uialertview

How to disable copy paste option from UITextField programmatically

这一生的挚爱 提交于 2019-11-26 13:04:22
I am making a registration alertview that has a UITextField in it where the user can enter their registration number. everything is pretty much their, however I would like to remove the copy paste function from the textfield programmatically since their is no InterfaceBuilder version of the textfield I have no idea how to do this.. here Is my UIalertview thus far... - (void)pleaseRegisterDevice { UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Please Register Device!" message:@"this gets covered" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil]; regTextField =

Unable to add UITextField to UIAlertView on iOS7…works in iOS 6

陌路散爱 提交于 2019-11-26 12:55:41
问题 The code below works on iOS6 (and before) but the UITextField does not display in iOS7...any ideas on how to get a UITextField to display in an UIAlterView in iOS7? UIAlertView* dialog = [[UIAlertView alloc] init]; [dialog setDelegate:self]; [dialog setTitle:@\"Enter ESC Score\"]; [dialog setMessage:@\" \"]; [dialog addButtonWithTitle:@\"Cancel\"]; [dialog addButtonWithTitle:@\"OK\"]; dialog.tag = 5; nameField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)];

How can I show alertview with activity indicator?

一个人想着一个人 提交于 2019-11-26 11:21:11
问题 I want to show alertview with message: \"Loading data\" and spinning activity indicator. How can I do this? 回答1: you can add a label and activityindicator as subviews of your alert view. you have to do some thing like this myAlertView = [[UIAlertView alloc] initWithTitle:@"Loading" message:@"\n\n" delegate:self cancelButtonTitle:@"" otherButtonTitles:@"OK", nil]; UIActivityIndicatorView *loading = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray

Is it possible to NOT dismiss a UIAlertView

天大地大妈咪最大 提交于 2019-11-26 11:20:37
问题 The UIAlertviewDelegate protocol has several optional methods including: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex; This would seem to suggest that not all button clicks actually dismiss the alert view. However I see no way of configuring the alert view to NOT automatically dismiss with any button press. Do I have to create a subclass to accomplish this? Why would the UIAlertViewDelegate Protocol have: - (void)alertView:(UIAlertView *)alertView

iOS: Custom permission alert view text

岁酱吖の 提交于 2019-11-26 11:03:01
问题 Anyway to custom permission alert view like: Contacts, Photo Album, Push Notifications... before they get access, they will pop up an alert view like this: How to custom Contacts, photo album, push notifications alert view text? UPdate: See the update image above, translate into english: \"To seek for your family and friends, Path needs to transfer your contacts to our server\" And click OK to get contacts access without any other access permission alert view pops up. 回答1: Under iOS 6 and

AlertController is not in the window hierarchy

无人久伴 提交于 2019-11-26 10:56:58
问题 I\'ve just created a Single View Application project with ViewController class. I would like to show a UIAlertController from a function which is located inside my own class. Here is my class with an alert. class AlertController: UIViewController { func showAlert() { var alert = UIAlertController(title: \"abc\", message: \"def\", preferredStyle: .Alert) self.presentViewController(alert, animated: true, completion: nil) } } Here is ViewController which executes the alert. class ViewController:

Is it possible to show an Image in UIAlertView?

点点圈 提交于 2019-11-26 09:26:16
问题 Is it possible to add image in an UIAlertView, like showing an image from the plist file? 回答1: You can do it like: UIAlertView *successAlert = [[UIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(220, 10, 40, 40)]; NSString *path = [[NSString alloc] initWithString:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"smile.png"]]; UIImage

UIAlertView/UIAlertController iOS 7 and iOS 8 compatibility

北战南征 提交于 2019-11-26 09:18:25
问题 I am using Swift to write an app and I need to show an alert. The app must be iOS 7 and iOS 8 compatible. Since UIAlertView has been replaced with UIAlertController , how can I check if the UIAlertController is available without checking the system version? I have been hearing that Apple recommends that we should not check the system version of the device in order to determine the availability of an API. This is what I am using for iOS 8 but this crashes on iOS 7 with \" dyld: Symbol not

Custom Alert (UIAlertView) with swift

∥☆過路亽.° 提交于 2019-11-26 09:09:27
问题 How can i create a custom alert with Swift? I try translating a guide from Objective c but loads a full screen layout for do it easy i can load a new layout with the transparent background i try this: listaalertviewcontroller.view.backgroundColor = UIColor.clearColor() let purple = UIColor.purpleColor() // 1.0 alpha let semi = purple.colorWithAlphaComponent(0.5) listaalertviewcontroller.view.backgroundColor = semi presentingViewController.modalPresentationStyle = UIModalPresentationStyle

Writing handler for UIAlertAction

瘦欲@ 提交于 2019-11-26 08:05:22
问题 I\'m presenting a UIAlertView to the user and I can\'t figure out how to write the handler. This is my attempt: let alert = UIAlertController(title: \"Title\", message: \"Message\", preferredStyle: UIAlertControllerStyle.Alert) alert.addAction(UIAlertAction(title: \"Okay\", style: UIAlertActionStyle.Default, handler: {self in println(\"Foo\")}) I get a bunch of issues in Xcode. The documentation says convenience init(title title: String!, style style: UIAlertActionStyle, handler handler: (