uialertview

Simple UIAlertView with NSAttributedString(s)

送分小仙女□ 提交于 2019-12-07 06:13:30
问题 I am looking for a simple way to use NSAttributedString with a very simple message box similar to: NSString *new_item = [NSString stringWithFormat:@"<span style=\"font-family: Helvetica Neue; font-size: 12.0\">%@</span>", @"MOTD HTML String downloaded from website"]; NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[new_item dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];

How do I show all the buttons text with normal font on UIAlertView in ios

半世苍凉 提交于 2019-12-07 05:30:10
问题 In my iOSproject I have an UIAlertView with 3 buttons on it , but the last button text is defaulted to bold font like this... , how can I set the font style of third button text to normal ? following is the code used to create that alert view UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"test" message:@"testTestTest" delegate:Nil cancelButtonTitle:nil otherButtonTitles:@"first",@"second",@"third" ,nil]; [alert show]; 回答1: I spent some time on this and went to dig along subview

Attempt to present UIAlertController on View Controller which is already presenting (null) [Swift]

回眸只為那壹抹淺笑 提交于 2019-12-07 01:34:36
问题 I have an alert view that I am trying to present on a photo view. The photos are displayed in a list and can be pushed to a full-screen view. The photo view is being displayed programmatically. I think that is what is causing the issue because the alert view is trying to present another view, on top of the (photo) view that's already presented. The alert view is trying to display, but getting this error: Warning: Attempt to present <UIAlertController: 0x147d2c6b0> on <LiveDeadApp

How to show alert once after installing the app in ios device

耗尽温柔 提交于 2019-12-06 16:13:25
问题 How to show an alert only once at the start of an application after installing the application on device or on simulator until I delete it from my device. Is it possible tell me.. 回答1: You can do it this way: if (![[NSUserDefaults standardUserDefaults] boolForKey:@"HasLaunchedOnce"]) { //first launch //show your alert [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"HasLaunchedOnce"]; [[NSUserDefaults standardUserDefaults] synchronize]; } else { // app already launched } 来源: https:

UIAlertView Dynamically in iPhone App

孤者浪人 提交于 2019-12-06 15:16:08
问题 I want to display dynamic UIAlertView and Indicator within it when data is loading from web-service. Also I don't want any button on UIAlertView. And it will be stopped automatically when data will be loaded successfully. How can I implement it.? 回答1: If you are using WebView then write startAnimating ActivityIndicator in ViewDidLoad and this delegate method will call by itself when your data will be loaded - (void)webViewDidFinishLoad:(UIWebView *)webView { //[[UIApplication

wait_fences: failed to receive reply: 10004003 error - UIAlertView with UIActivityIndicatorView

荒凉一梦 提交于 2019-12-06 15:04:35
I hoped that the answers to squeezemylime's question would solve my problem as I also have a UIAlertView without text field but it did not work out well. Instead of a text field I placed a UIActivityIndicatorView animating on it and no buttons used on creation. So the alert gets programmatically dismissed so that the delegate method destroys the spinner on the alert and the alert itself (which has been retained through the time running). So, I'm getting also these wait_fences: messages within the debugger and I'm frozen in the meantime because everything I tried including the valuable hints in

iOS 7: UIAlertView created in UIActionSheet delegate function cannot auto rotate

一笑奈何 提交于 2019-12-06 13:56:40
The issue only can be reproduced in iOS 7. In the delegate function: - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex , if a UIAlertView is created, the alert view cannot auto rotate. Here is the sample code: - (IBAction)buttonTapped:(id)sender { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"action sheet" delegate:self cancelButtonTitle:@"cancel" destructiveButtonTitle:@"ok" otherButtonTitles:nil]; [actionSheet showInView:self.view]; } - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {

Make a UIAlertView show after second launch

只愿长相守 提交于 2019-12-06 13:40:54
问题 If that isn't possible, then how may I do it after, say, 3 minutes of app usage? This is going to be used for a Rate Us alert but I would rather the user have some time to actually use the app before it asks for them to rate. 回答1: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)options { // ... if ([self plusPlusLaunchCount] == 2) { [self showRateUsAlert]; } return YES; } - (void)showRateUsAlert { // show the Rate Us alert view } - (NSInteger

How to access user input from UIAlertView completion block without delegation?

房东的猫 提交于 2019-12-06 13:31:59
问题 Using iOS6: I would like to retrieve the text entered by a user into a UITextField associated with the UIAlertView. I am aware that I could achieve the desired result with a delegate however I am curious about solving this issue with a callback function as I believe this may be an interesting pattern. I began by examining a common pattern for category extension of the UIAlertView class. Code below. Thanks in advance for any suggestions. import <UIKit/UIKit.h> @interface UIAlertView (Block) -

How to change color of the UIAlertView dialog in iOS?

百般思念 提交于 2019-12-06 12:52:35
问题 I have an application where I am showing an alert message using UIAlertView. By default the color of the dialog box is blue. Can anyone tell me, how to change the color of that? Can it be changed? 回答1: Use Like This [CustomAlert setBackgroundColor:[UIColor blueColor] withStrokeColor:[UIColor greenColor]]; .h and .m File's Content CustomAlert.h #import <UIKit/UIKit.h> @interface CustomAlert : UIAlertView { } + (void) setBackgroundColor:(UIColor *) background withStrokeColor:(UIColor *) stroke;