uialertview

Is it possible to lay out 2 buttons vertically on UIAlertView?

两盒软妹~` 提交于 2019-11-28 01:17:47
I want to create UIAlertView with two buttons. I need to lay out these buttons vertically (my text is too big). Is it possible ? Screen1 Screen2 It's not possible by default. The appearance shown in nycynik's answer is what happens when you have more than two buttons. So, either add another button, or you could look into a third-party solution such as this library , although I have not tested it. There seems to be no SDK support for this behavior. Two buttons in a UIAlertView will always be shown in a horizontal layout. However, it's pretty easy to just subclass UIAlertView to get the intended

Dismissing a UIAlertView in ios 7 not working?

倾然丶 夕夏残阳落幕 提交于 2019-11-28 00:30:36
问题 I'm trying to dismiss a UIAlertView before showing another and I found the answer here: iOS dismiss UIAlertView beforing showing another The problem is that this is not working on iOS7 but works on iOS6. This is working in iOS6 -(void)closePreviousAlert{ for (UIWindow* w in [UIApplication sharedApplication].windows) for (NSObject* o in w.subviews) if ([o isKindOfClass:[UIAlertView class]]) [(UIAlertView*)o dismissWithClickedButtonIndex:[(UIAlertView*)o cancelButtonIndex] animated:YES]; } Is

iOS How to dismiss UIAlertView with one tap anywhere?

强颜欢笑 提交于 2019-11-27 23:02:32
I want to dismiss UIAlertView anywhere outside it with one tap. I want to show a UIAlertView without any button. I have standard UIAlertView codes here, but I need input how to dismiss it, if it is possible. With UITouch? With UITapGestureRecognizer? Thank you. EDIT: in viewDidLoad alertview initialization here with name "alert" if (alert) { emptyview = [[UIView alloc]initWithFrame:CGRectMake(0,0,320,480)]; emptyview.backgroundColor = [UIColor clearColor]; [self.view addSubview:emptyview]; [emptyview addSubview:alert]; NSLog (@"emptyview is there!"); UITapGestureRecognizer *singleTap = [

Concurrent UIAlertControllers

给你一囗甜甜゛ 提交于 2019-11-27 22:12:18
I'm porting my app to iOS 8.0 and notice that UIAlertView is deprecated. So I've changed things to use a UIAlertController. Which works in most circumstances. Except, when my app opens, it does several checks to report various states back to the user... E.g... "Warning, you haven't set X up and need to do Y before completing projects" and "Warning, you are using a beta version and do not rely on results" etc...(these are just examples!) Under the UIAlertView, I would (say) get two alert boxes concurrently which the user has to tap twice to dismiss both...but they both appear. Under

UIAlertController if iOS 8, otherwise UIAlertView

那年仲夏 提交于 2019-11-27 22:01:16
问题 I want to conform to the UIAlertController used in iOS 8 since UIAlertView is now deprecated. Is there a way that I can use this without breaking support for iOS 7? Is there some kind of if condition I can do to check for iOS 8 otherwise do something else for iOS 7 support? 回答1: Please see the answer of Erwan (below my answer) as I see it is the best. -- You can check the iOS version to use appropriate control like this: if (([[[UIDevice currentDevice] systemVersion] compare:@"8.0" options

problem in changing size of uialertview

流过昼夜 提交于 2019-11-27 21:34:07
Hello I am having a alertview and i want to change the size by cgrectmake property but it does not happen . It just take the by default size. i tried following code. - (void)viewDidLoad { [super viewDidLoad]; UIAlertView* find = [[[UIAlertView alloc] init]initWithFrame:CGRectMake(0,0,300,200)]; [find setDelegate:self]; [find setTitle:@"Sample Alert"]; [find setNeedsLayout]; [find show]; [find release]; } Thanks in advance . To achieve what you want, in your code, after: [find show]; add: find.frame = CGRectMake(0,0,300,200); It's not pretty though, I suggest you use ActionSheets. Pankaj

Display UIAlertController from UIView/NSObject class

杀马特。学长 韩版系。学妹 提交于 2019-11-27 20:30:53
I have working iOS application In order to support iOS8 , I am replacing UIAlertView/UIActionSheet with UIAlertController . Problem : For display UIAlertController I need presentViewController method of UIViewController class. But UIAlertView is display from classes which are inherited from UIView or NSObject , I can not get [self presentViewController...] method for obvious reason. My Work : I tried getting rootViewController form current window and display UIAlertController. [[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController ...] but have some rotation

NSLocalizedString only retrieves the key, not the value in Localizable.strings (IOS)

时光总嘲笑我的痴心妄想 提交于 2019-11-27 20:22:59
I've made a strings file named "Localizable.strings" and added two languages to it, like so: "CONNECTIONERROR" = "Check that you have a working internet connection."; "CONNECTIONERRORTITLE" = "Network error"; I have also converted the files to Unicode UTF-8 However, when I create a UIAlertView like this: UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"CONNECTIONERRORITLE",nil) message:NSLocalizedString(@"CONNECTIONERROR",nil) delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; the alert view only shows the key text, not the value. It works if I, for

Adding a simple UIAlertView

 ̄綄美尐妖づ 提交于 2019-11-27 19:48:31
问题 What is some starter code I could use to make a simple UIAlertView with one "OK" button on it? 回答1: When you want the alert to show, do this: UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"ROFL" message:@"Dee dee doo doo." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; // If you're not using ARC, you will need to release the alert view. // [alert release]; If you want to do something when the button is clicked, implement this delegate method: - (void

How can I schedule local notification for the following scenario?

三世轮回 提交于 2019-11-27 19:21:43
Experts, I have a scenario wherein I need to notify user three times a day (morning, afternoon, evening). And the timings for these notifications will be different for each day, based on database values for each date. These three notifications are configurable. Meaning user might just choose to set afternoon and evening while turning off morning notification under settings. As per my understanding I can achieve this using local notifications. I can do the following: - before the application exits, inside didFinishLaunchingWithOptions, I can check what is the next notification due, is it set