uialertview

iOS: Is there a way to make a viewcontroller look inactive by having everything grayed out?

本秂侑毒 提交于 2019-12-14 01:23:28
问题 I want my ViewController and every object appear inactive by having it all grayed out (kind of like how the UIAlertView popup grays out everything in the background). I do not want to have to manually gray out every object there is.Is there an easy way to make this work? 回答1: UIView *grayView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; grayView.backgroundColor = [UIColor colorWithWhite:0.5 alpha:0.5]; [self.view addSubview:grayView]; You can mess with the white and alpha

iOS 5 black transparent UIAlertView

情到浓时终转凉″ 提交于 2019-12-13 22:14:02
问题 I'm aware that this question has been asked before for earlier versions of iOS, however, as far as I remember, people at the WWDC this year emphasised that we can finally customise everything very easily, e.g. the tint colours of switches (UISwitch onTintColor etc.). I had a look at the AlertView but the only options are password input / text input. Perhaps I'm missing something obvious here, but is it still not possible to change the background tint colour of an UIAlertView in iOS 5 easily?

UIAlertView crash issue on another view controller

倖福魔咒の 提交于 2019-12-13 21:59:14
问题 I have 2 view controllers, ViewController 1(VC1) and 2(VC2). In VC2 I have a back and done button. On clicking back button it goes directly to VC1 and on done it makes an api call and when it gets a response it shows an alert view and clicking ok goes back to VC1. Now when I make a api call a loading bar shows up and disappears when I get response and shows the AlertView . But if during that fraction of second when the loading disappears and AlertView is going to be popped up if I click on

Move buttons down in UIAlertView

寵の児 提交于 2019-12-13 18:05:44
问题 I have an app which displays in landscape mode and I've overwritten the height of a UIAlertView with the following code: - (void) willPresentAlertView:(UIAlertView *)alertView { CGRect screenBounds = [[UIScreen mainScreen] bounds]; CGRect frame = [alertView frame]; alertView.frame = CGRectMake(frame.origin.x, 0, frame.size.width, screenBounds.size.width); } This almost works. The UIAlertView is taller, however, the buttons in the alertview don't get pushed down. Does anyone know how I can

UIAlertView delegate method crashing

穿精又带淫゛_ 提交于 2019-12-13 16:55:41
问题 In my iPhone app, I have a NSObject A class and a UIViewController B class. I want to call a instance method in B class from A. I used the following code. Bclass *vc = [[Bclass alloc]init]; [vc hideAlert:NSString]; [vc release]; and in B class: - (void)hideAlert:(NSString*)message{ UIAlertView *shareAlrt = [[UIAlertView alloc] initWithTitle:@"" message:message delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [shareAlrt show]; [shareAlrt release]; } and the method called and show

Change UIAlertView size

会有一股神秘感。 提交于 2019-12-13 16:00:32
问题 In my cocos2d game i can't change size of uialertview, i have changed statusbarorientation to landscape, and now want to init alertview with frame, and initwithframe method does not affect the size of alertview, every time the size of alert is the same, is there any way to change it ? 回答1: Here is what i did. Create your uialertview in your controller. then override the following class within your controller (after setting the uialertview delegate ... ie. myalertview.delegate=viewcontroller)

How to do delete confirmation on iPad according to the human interface guidelines

五迷三道 提交于 2019-12-13 14:24:35
问题 Reading through the iOS Human Interface Guidelines, it appears that there is no "right" way to have the user confirm before deleting. The Guidelines list 3 things when dealing with UIAlertView and UIActionSheet: Do not use an alert view to confirm a user-initiated action. Do not include a "cancel" button on an action sheet (on the iPad). An action sheet must have at least 2 buttons. So... I need to have the user confirm that they want to delete something. The only choices to present them with

UIAlertView makes the program crash

故事扮演 提交于 2019-12-13 13:14:04
问题 I've got a crash: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIKeyboardTaskQueue performTask:] may only be called from the main thread.' And I could not find a solution for 2 days. And here is the code: [alert dismissWithClickedButtonIndex:0 animated:YES]; UIAlertView *noTicketAlert = [[UIAlertView alloc] initWithTitle:@"Aradığınız kriterlere uygun bilet bulunamadı!" message:nil delegate:self cancelButtonTitle:@"Tamam" otherButtonTitles: nil];

The delegate method “clickedButtonAtIndex:” is not called

女生的网名这么多〃 提交于 2019-12-13 11:45:46
问题 I have created an alert view with two buttons using the following code: UIAlertView *alertView = [[UIAlertView alloc] initWithTitle: title message: msg delegate:nil cancelButtonTitle:@"Replay" otherButtonTitles:@"Highscore", nil]; [alertView show]; I want to run some code when one of the buttons is clicked. In order to do so, I have added the following method to the delegate.m file: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex==0) /

UIAlertview Delegate Method not calling in Child View Controller

拥有回忆 提交于 2019-12-13 11:01:50
问题 I have two controllers VC A -> Parent and VC B -> Child Alert view delegate method i.e func alertView(View: UIAlertView!, clickedButtonAtIndex buttonIndex: Int){} is declared in VC A . When i display alert from VC B delegate method is not called on alert button clicked. 回答1: protocol alertViewDelegate:class { func alertView(View: UIAlertView!, clickedButtonAtIndex buttonIndex: Int) } Create an alert view delegate object in parent class VC A weak var delegate:alertViewDelegate() ?= nil