uialertview

iOS Beginner: UIAlertView Window with 3 Buttons > Check what button was pressed

安稳与你 提交于 2020-02-03 04:51:05
问题 I have a working code from a tutorial but don't understand it completely. Situation: After a button was pressed in my iPhone App an AlertView appears with three buttons. Now I like to check what button the user pressed. CODE FROM THE TUTORIAL: - (IBAction)infoButtonPressed:(id)sender { UIAlertView *myAlert1 = [[UIAlertView alloc]initWithTitle:@"My Alert View 1" message:@"Here we go" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Option1", @"Option2", nil]; [alert show]; } -

Can I move a UIAlertView?

我只是一个虾纸丫 提交于 2020-01-31 10:49:29
问题 I've been moving an alert view slightly higher so i can fit a keyboard on screen as well. I just do this by grabbing the frame of the alert and changing the Y after i have already shown the alert so that the frame variables are legit. This works fine on the simulator, but when I do this on the hardware, the alert starts at the correct position but then almost immediately jumps down to it's original vertical center place. Is the UIAlertView position a fixed thing that isn't supposed to change

Can I move a UIAlertView?

女生的网名这么多〃 提交于 2020-01-31 10:49:18
问题 I've been moving an alert view slightly higher so i can fit a keyboard on screen as well. I just do this by grabbing the frame of the alert and changing the Y after i have already shown the alert so that the frame variables are legit. This works fine on the simulator, but when I do this on the hardware, the alert starts at the correct position but then almost immediately jumps down to it's original vertical center place. Is the UIAlertView position a fixed thing that isn't supposed to change

UIAlertView takes a long time to appear when called in a completion block

青春壹個敷衍的年華 提交于 2020-01-29 18:04:19
问题 Part of my app requires calendar access, which requires a call to the EKEventStore method -(void)requestAccessToEntityType:(EKEntityType)entityType completion:(EKEventStoreRequestAccessCompletionHandler)completion as of iOS 7. I added the request, and everything runs smoothly if the user selects to allow access, but a problem arises if the user denies or has previously denied access. I added a UIAlertView to notify the user if access is denied, but the UIAlertView consistently takes 20-30

UIAlertView takes a long time to appear when called in a completion block

和自甴很熟 提交于 2020-01-29 17:58:28
问题 Part of my app requires calendar access, which requires a call to the EKEventStore method -(void)requestAccessToEntityType:(EKEntityType)entityType completion:(EKEventStoreRequestAccessCompletionHandler)completion as of iOS 7. I added the request, and everything runs smoothly if the user selects to allow access, but a problem arises if the user denies or has previously denied access. I added a UIAlertView to notify the user if access is denied, but the UIAlertView consistently takes 20-30

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