uialertview

prevent UIAlertView from dismissing

吃可爱长大的小学妹 提交于 2019-12-04 00:41:33
问题 As a form of validation, is there any way to prevent an alert view from dismissing when pressing an "OK" button? Scenario: I have 2 text fields in the alertview for username/password. If both are empty and the user presses "OK", I do not want the alert to be dismissed. 回答1: iOS 5 introduces a new property to UIAlertView to handle exactly this problem. alert.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput; Apple documentation on UIAlertView. Add the new UIAlertViewDelegate method to

change position of cancel button in UIAlertView?

假如想象 提交于 2019-12-04 00:29:10
I noticed that when I delete an app from my iPhone home screen, the alert view that appears shows a Delete button on the left and Cancel on the right. However, when I build a delete function within my app using UIAlertView, the buttons only seem to display with Cancel on the left and Delete on the right. I'd like my app to be consistent with the OS, but I can't figure out how to make the Cancel button appear first. Does anyone know? UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Delete Song" message:@"Are you sure you want to delete this song? This will permanently remove it from

Subclassed UIAlertView not drawn correctly in iOS 4.2

安稳与你 提交于 2019-12-03 22:36:35
问题 I've subclassed an UIAlertView as follow: @interface NarrationAlertView : UIAlertView { UIImage * backgroundImage; //The image I want as custom background UILabel * textualNarrationView; //The test I wanna be displayed on the view } And implemented it this way : - (id)initNarrationViewWithImage:(UIImage *)image{ if (self = [super init]){ UILabel * alertTextLabel = [[UILabel alloc] initWithFrame:CGRectZero]; self.textualNarrationView = alertTextLabel; [alertTextLabel release]; [self addSubview

How to remove Enter Password and Cancel button from Touch ID alert view

泄露秘密 提交于 2019-12-03 22:21:39
I got stuck that don't want Enter Password in the Alert of thumb impression [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:NSLocalizedString(@"UNLOCK_ACCESS_TO_LOCKED_FEATURE", nil) reply: ^(BOOL success, NSError *authenticationError) { if (success) { msg =[NSString stringWithFormat:NSLocalizedString(@"EVALUATE_POLICY_SUCCESS", nil)]; } else { msg = [NSString stringWithFormat:NSLocalizedString(@"EVALUATE_POLICY_WITH_ERROR", nil), authenticationError.localizedDescription]; } }]; } To hide the button "Enter password", you need to set

Hide UIAlertView programmatically?

和自甴很熟 提交于 2019-12-03 22:03:43
Is there a way to hide UIAlertView programmatically? Actually I have added a UITextField in UIAlertView and I want to perform the same operation as on "Ok" button press when a user hits the keyboard return key. Call [theAlertView dismissWithClickedButtonIndex:0 animated:YES]; when you handle the return key. 来源: https://stackoverflow.com/questions/3853887/hide-uialertview-programmatically

Swift 4 Attempt to present ViewController whose view is not in the window hierarchy

帅比萌擦擦* 提交于 2019-12-03 20:08:07
I am using swift 4 and I am trying to create an alertView when I there is an error while signing up a user using Firebase . I have an IBAction for the sign up button which will sign the user up using text from two textfields , one for email and one for password. I am basically trying to show an alertview when there is an error with the sign up process, for example there is an empty textfield . I have attached a screenshot of the function to where that is occuring. I know that I am in fact getting an error because the print statement outputs an error if there is one. Regardless of if there is

Notify User about new update of application in app store as a alert and automatically install updated version in iPhone?

强颜欢笑 提交于 2019-12-03 19:06:02
Currently my application with version 1.1 is available in app store. Current Scenario: when i update new version update is shown in app store when user goes to app store. Required: As soon as user starts application alert should be popped up and if new version is available in app store it should automatically install that if user clicks OK . Please suggest me the way to do this. You can't make it install automatically, you can send the user to the app store app with your itunes app url. Also you will need to make you're own webservice to check if a new version is available. 来源: https:/

Always return Error FBErrorCategoryUserCancelled while login with facebook in my application

旧城冷巷雨未停 提交于 2019-12-03 17:13:40
问题 In my Application there are three ways of login. one of them is login with facebook. But when I click on facebook button it ask me for accesing permissions, when click OK then it returs error FBErrorCategoryUserCancelled . And this is not happening on every devices, it happens on some devices. Here is my code - if ([[FBSession activeSession]isOpen]) { /* * if the current session has no publish permission we need to reauthorize */ if ([[[FBSession activeSession]permissions]indexOfObject:@

Knowing when user has pressed cancel buttons during In-App purchase

一个人想着一个人 提交于 2019-12-03 16:58:32
I am writing code for in-app purchases and using a "Processing..." view with an activity indicator to block the "Buy Now" button once a purchase is initiated. However, how can you tell when the user hits a "Cancel" button since those alert views are coming from the AppStore.app? Is there a delegate method that gets called when those cancel buttons are pressed? Or is it a matter of your view becoming firstResponder again? What am I missing here? If you don't think this is possible, have a look at the "I Am T-Pain" app... they do something very similar and dismiss their view immediately after

Showing cellular data is turned off alert

吃可爱长大的小学妹 提交于 2019-12-03 16:56:32
How can I show this alert view? I know that I need check connection with reachability, but how do I show this alert with settings and ok button? I need it for iOS 6. Unfortunately in iOS 5.1 and later you can't open settings app from your app. If you are using lesser version the following will work. Create the Alert view like: UIAlertView *cellularData = [[UIAlertView alloc] initWithTitle: @"Cellular Data is Turned Off" message:@"Turn on ellular data or use Wi-Fi to access data" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Settings", nil]; [cellularData show]; Implement the