uialertview

how to add a UITableView into UIAlertView in iOS 7

南笙酒味 提交于 2019-12-18 07:03:12
问题 did some googling around saw that subview is no longer supported in iOS 7. Some ppl recommend creating custom view, but i am not sure how can i do that. Here is my code, can anyone point me in the correct direction? -(IBAction)click_select_fruit_type { select_dialog = [[[UIAlertView alloc] init] retain]; [select_dialog setDelegate:self]; [select_dialog setTitle:@"Fruit Type"]; [select_dialog setMessage:@"\n\n\n\n"]; [select_dialog addButtonWithTitle:@"Cancel"]; idType_table = [[UITableView

Custom AlertView With Background

半世苍凉 提交于 2019-12-18 05:12:55
问题 Everybody, I need to set one image on UIAlertView.. I have attached my UIAlertview with image prob.. i have used this code lines.. UIAlertView *theAlert = [[[UIAlertView alloc] initWithTitle:@"Atention" message: @"YOUR MESSAGE HERE", nil) delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease]; [theAlert show]; UILabel *theTitle = [theAlert valueForKey:@"_titleLabel"]; [theTitle setTextColor:[UIColor redColor]]; UILabel *theBody = [theAlert valueForKey:@"_bodyTextLabel"];

UIAlertView crashs in iOS 8.3

不羁的心 提交于 2019-12-18 04:02:10
问题 recently i start receiving crash reports for UIAlertView only by users that use iOS 8.3 Crashlytics reports: Fatal Exception: UIApplicationInvalidInterfaceOrientation Supported orientations has no common orientation with the application, and [_UIAlertShimPresentingViewController shouldAutorotate] is returning YES The line where that crash happens is [alertView show] : UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle

iOS dismiss UIAlertView beforing showing another

北战南征 提交于 2019-12-17 21:56:39
问题 I have a Utils class which shows UIAlertView when certain notifications are triggered. Is there a way to dismiss any open UIAlertViews before showing a new one? Currenty I am doing this when the app enters the background using [self checkViews:application.windows]; on applicationDidEnterBackground - (void)checkViews:(NSArray *)subviews { Class AVClass = [UIAlertView class]; Class ASClass = [UIActionSheet class]; for (UIView * subview in subviews){ if ([subview isKindOfClass:AVClass]){ [

UIAlertView automatic newline gone in iOS8?

本小妞迷上赌 提交于 2019-12-17 20:39:43
问题 It appears that UIAlertView is not compatible with iOS8. I've just discovered that all my multiline UIAlertViews become truncated one-liners in iOS8 (for the message). In iOS7 they are displayed correctly with multilines. iOS7: iOS8: [[[UIAlertView alloc] initWithTitle:@"Namn saknas" message:@"Du måste fylla i ditt namn för att kommentera" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil] show]; I'm aware of that UIAlertController should be used in iOS8 and later and that

iOS multiple text fields on a UIAlertview In IOS 7

爷,独闯天下 提交于 2019-12-17 19:36:37
问题 So the new iOS 7 has come out and I'm trying to add multiple textFields and labels to the UIAlertviews. I need three. I've been trying to add them as subviews and that doesn't work anymore. I have also tried to add multiple lines with the UIAlertViewStylePlainTextInput but it only seems to return one text field. I need to add in labels to show them what to enter as well. Is there a way to accomplish this task with the new iOS 7? 回答1: The only solution i found using UIAlertView with more than

How to change button text color of UIAlertView in iOS7?

夙愿已清 提交于 2019-12-17 18:34:49
问题 iOS7 introduced general tint-color. I think UIAlertView is also in the valid range, but actually tintColor doesn't look to work with UIAlertView . (for tappable button text color) Is it possible to change the tint-color of alert view? If possible, how to change it? 回答1: Unfortunately you cannot customize the appearance of alert views, it is impossible to change the buttons text color. It is mentioned clearly in UIAlertView Class Reference: The UIAlertView class is intended to be used as-is

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

孤街浪徒 提交于 2019-12-17 15:53:24
问题 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"

iOS UIAlertView button to go to Setting App

孤者浪人 提交于 2019-12-17 10:10:47
问题 Is there a way to have the button of a UIAlertView go to the Settings App for the specific App calling it? Thanks 回答1: For example: NSURL*url=[NSURL URLWithString:@"prefs:root=WIFI"]; [[UIApplication sharedApplication] openURL:url]; And [font=] About — prefs:root=General&path=About Accessibility — prefs:root=General&path=ACCESSIBILITY Airplane Mode On — prefs:root=AIRPLANE_MODE Auto-Lock — prefs:root=General&path=AUTOLOCK Brightness — prefs:root=Brightness Bluetooth — prefs:root=General&path

How to add userInfo to a UIAlertView?

随声附和 提交于 2019-12-17 08:59:39
问题 I would like to know how to add a userInfo object, or any NSDictionary, to a UIAlertView? Thank you. 回答1: If you are on > iOS 4.0 (for blocks) and you only want one or two buttons, you could use this category I made: https://github.com/rsaunders100/UIAlertView-Blocks It bypasses the need to add user info since you put your click handeling function straight into the alert. e.g. #import UIAlertView+Blocks.h ... ... NSString* myUserInfo = @"example"; [UIAlertView displayAlertWithTitle:@"Example