uialertview

How to add Cancel button between two other buttons (stacked) in UIAlertView (iOS)

六月ゝ 毕业季﹏ 提交于 2019-12-12 19:02:43
问题 I am trying to create a UIAlertView with three buttons (which will be stacked). I would like the Cancel button to be in the middle, between the two other buttons. I have tried setting the cancelButtonIndex to 1, but if there are two other buttons, it simply places them at indexes 0 and 1. I know I could just change the names of the buttons, but I want the darker blue formatting of the cancel button. EDIT: ** Please note - I know how to get the three buttons with the titles in the correct

UIActionSheet from UIAlertView

☆樱花仙子☆ 提交于 2019-12-12 16:12:09
问题 I'm trying to show a UIActionSheet when the user touches a button in a UIAlertView: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 0) { UIActionSheet *actionSheet = ... [actionSheet showFromTabBar:self.tabBarController.tabBar]; } } When the action sheet is shown the alert view is still on the screen behind the action sheet, and when I touch a button in the action sheet - the action sheet disappears but the whole screen is dimmed

How to add image with text into UIAlertView?

本秂侑毒 提交于 2019-12-12 11:28:04
问题 I want to add image with some text into UIAlertView like given image below Here is my code UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"Please use Settings( ) to configure the phone number and image." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(160.5, 27, 15, 15)]; imageView.image = [UIImage imageNamed:@"settingIcon.png"]; [alert addSubview:imageView]; [alert show]; But image is

UIDatePicker customization

自闭症网瘾萝莉.ら 提交于 2019-12-12 11:23:22
问题 I have customized UIDatePicker to a level and I am adding it to UIAlertView. but I am getting a black color on the bottom and the top of date picker, how to remove it. I want the date picker to be neat and clean. The code I use to achieve this: UIDatePicker *datePicker = [[UIDatePicker alloc] init]; datePicker.frame=CGRectMake(20, 45.0, 240.0, 150.0); datePicker.minimumDate=[NSDate date]; //Forget about this logic. NSString *alertTitleString=@""; if(self.presentingViewController !=nil) {

Change tint color of UIAlertview and UIActionsheet buttons

耗尽温柔 提交于 2019-12-12 09:37:28
问题 I am trying to adapt my application for iOS 7. The issue I am having is I can not change the tint color of some controls. I did add self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; if (IOS7_OR_LATER) self.window.tintColor = [self greenTintColor]; to my app delegate's - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions It mostly helped but color of message box and action sheet buttons is still

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

≡放荡痞女 提交于 2019-12-12 08:18:19
问题 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

Showing cellular data is turned off alert

▼魔方 西西 提交于 2019-12-12 08:09:49
问题 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. 回答1: 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

Remove an item from a UICollectionView

和自甴很熟 提交于 2019-12-12 07:39:30
问题 I have a set of images showing in a UICollectionView . When the user taps on an image, it spawns a UIActionSheet with a few options for that image. One of them id removing the photo from the UICollectionView . When the user selects remove button in the UIActionSheet , it pops up an alert view asking for confirmation. If the user selects yes, it should remove the photo. My problem is, to remove the item from the UICollectionView , you have to pass the indexPath to the deleteItemsAtIndexPaths

UIAlertView alert repeat three times within long press gesture recognizer

百般思念 提交于 2019-12-12 06:29:48
问题 I created an application. Through developing it, i used long press button to show an alert. This is my code: - (IBAction)longPressDetected1:(UIGestureRecognizer *)sender { // label1.text = @"Select Iran to observe its historical data projections "; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"Press the blue button (+) to select your region " delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; } Question: When I want to cancel the UIAlertView by

how to dismiss alert view after validation?

浪子不回头ぞ 提交于 2019-12-12 06:16:41
问题 I had used SCLAlertView used for forgot password in this i had placed a textfield to enter email so that after making successful validation only it need to hide without this it should not hide can anyone help me how to implement this ? My code is shown below @IBAction func forgetPasswordButton(_ sender: Any) { let appearance = SCLAlertView.SCLAppearance(showCloseButton: true) let alert = SCLAlertView(appearance: appearance) let txt = alert.addTextField("Enter your emailid") _ = alert