uialertview


How to dismiss UIAlertController when tap outside the UIAlertController?

可紊 提交于 2020-01-26 18:59:24
问题 How to dismiss UIAlertController when tap outside the UIAlertController ? I can add a UIAlertAction of style UIAlertActionStyleCancel to dismiss the UIAlertController . But I want to add the function that when user tap outside the UIAlertController the UIAlertController will dismiss. How to do that? Thank you. 回答1: Add a separate cancel action with style UIAlertActionStyleCancel . So that when user taps outside, you would get the callback. Obj-c UIAlertController *alertController =

How to dismiss UIAlertController when tap outside the UIAlertController?

萝らか妹 提交于 2020-01-26 18:58:09
问题 How to dismiss UIAlertController when tap outside the UIAlertController ? I can add a UIAlertAction of style UIAlertActionStyleCancel to dismiss the UIAlertController . But I want to add the function that when user tap outside the UIAlertController the UIAlertController will dismiss. How to do that? Thank you. 回答1: Add a separate cancel action with style UIAlertActionStyleCancel . So that when user taps outside, you would get the callback. Obj-c UIAlertController *alertController =

Customizing the buttons on a UIAlertView

泪湿孤枕 提交于 2020-01-21 10:11:45
问题 This is the current way i'm customizing my buttons: UIAlertView *av = [[UIAlertView alloc] init]; [av addButtonWithTitle:@""]; UIButton *yesButton = [av.subviews lastObject]; [av show]; [yesButton setImage:[UIImage imageNamed:@"test.png"] forState:UIControlStateNormal]; The problem with this is that the original view is still visible around the image I set for the button. It doesn't completely encapsulate the image. Here's an example of what I have so far: https://www.dropbox.com/s

Detecting button click with UIAlertView

时光总嘲笑我的痴心妄想 提交于 2020-01-21 02:33:11
问题 I am trying to call and alert when a button is pressed. i use this : -(IBAction)Add { UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"add button pressed" message:@"Add to record" delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil ]; [alert show]; [alert release]; } ok , no problem here, two button came up, OK and cancel. Now i want detect which button is pressed i use: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { // the

UIAlertview message not Showing properly

流过昼夜 提交于 2020-01-17 03:18:06
问题 I'm having a UIAlertView and declared as UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"NEW_ALBUM" message:@"ENTER_ALBUM_NAME" delegate:self cancelButtonTitle:@"CANCEL" otherButtonTitles:@"Ok",nil]; alert.tag = 999; alert.alertViewStyle = UIAlertViewStylePlainTextInput; [alert show]; [alert release]; the resultant alert was shown as 来源: https://stackoverflow.com/questions/19288340/uialertview-message-not-showing-properly

Display UIAlertView before opening phone.app

一世执手 提交于 2020-01-16 16:57:18
问题 I have a view on map with a button and a label on the button. On the label i have phone number that comes from a plist. The variable of the phone number in the plist called "storePhone" and i implemented it in this way: text4.text = myAnn.storePhone; I made this method for pressing the button and opening the phone.app for dialing the number. Everything works great but i want a UIViewAlert to say to the user something like:"your going to dial this number, are you sure?" before the phone.app is

Display UIAlertView before opening phone.app

ⅰ亾dé卋堺 提交于 2020-01-16 16:57:05
问题 I have a view on map with a button and a label on the button. On the label i have phone number that comes from a plist. The variable of the phone number in the plist called "storePhone" and i implemented it in this way: text4.text = myAnn.storePhone; I made this method for pressing the button and opening the phone.app for dialing the number. Everything works great but i want a UIViewAlert to say to the user something like:"your going to dial this number, are you sure?" before the phone.app is

2 UIAlertView with 3 buttons?

你说的曾经没有我的故事 提交于 2020-01-16 15:43:11
问题 I wanna know how can I make 2 UIAlertView, with 3 buttons, the UIAlertViews(2) needs be different, the options and the actions... how ??? 回答1: Try this: UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome" message:@"Message." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:@"Button 2", @"Button 3", nil]; alert.tag = 1; [alert show]; then do the same for the next alertView, just change the tag to 2 Then just run this method - (void)alertView:(UIAlertView *)alertView

2 UIAlertView with 3 buttons?

与世无争的帅哥 提交于 2020-01-16 15:43:05
问题 I wanna know how can I make 2 UIAlertView, with 3 buttons, the UIAlertViews(2) needs be different, the options and the actions... how ??? 回答1: Try this: UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome" message:@"Message." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:@"Button 2", @"Button 3", nil]; alert.tag = 1; [alert show]; then do the same for the next alertView, just change the tag to 2 Then just run this method - (void)alertView:(UIAlertView *)alertView

Customize UIAlertButton through layoutSubviews => UIAlertButton class not found

一个人想着一个人 提交于 2020-01-15 11:42:49
问题 i'm trying to implement custom alert view using this tutorial. All in this tut work well, but it doesn't speak about customizing UIAlertButton. Then, i'm trying to customize it through layoutSubviews method: - (void)layoutSubviews { for (UIView *subview in self.subviews){ //Fast Enumeration if ([subview isMemberOfClass:[UIImageView class]]) { subview.hidden = YES; //Hide UIImageView Containing Blue Background } if ([subview isMemberOfClass:[UILabel class]]) { //Point to UILabels To Change

工具导航Map