uialertview

Setting UIAlertView button's color in swift

十年热恋 提交于 2019-12-02 05:26:42
i'm a new swift programmer and i need to change the color of my UIAlertView's button's color. for example i want to change the UIColor of that to yellow. can you help me please? You can change the tintColor like so: alert.view.tintColor = UIColor.blackColor() But customizing a UIAlertView is frowned upon by Apple. The UIAlertView class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified. UIAlertView Class Reference There are alternatives though. 来源: https://stackoverflow.com/questions/30737983/setting-uialertview

Open Settings.app When Button is Tapped in UIAlertView on iPhone SDK [duplicate]

此生再无相见时 提交于 2019-12-02 04:12:43
Possible Duplicate: Opening the Settings app from another app Is there a way to direct the user to the Settings.app whenever I show a UIAlertView prompt? This prompt alerts the user that his location services is turned off and I want the user to open the Settings.app when he taps the button inside my UIAlertView . UPDATE: I'm looking for a similar code stated here: How to launch myapplication settings tab in settings app from my application in ipad Midhun MP iOS 8 and iOS 9 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; There is no way to

How to send in-app announcements to people using my iOS app?

。_饼干妹妹 提交于 2019-12-02 03:56:21
I have a couple apps on the Apple App Store and would like some way to send announcements to users whenever I want. Basically, I want to remotely change the text of an IUAlertview and only trigger it to appear if I want it to (upon app opening and only if I updated the message). So far I have no problem making the IUAlertview appear on when the app opens, and I can easily program an NSUserDefault flag to only make the IUAlertview appear under certain circumstances, but really have no idea how to dynamically change the UIAlertview text without resubmitting my app to Apple continuously. Can

UIAlertView starts to show, screen dims, but it doesn't pop up until it's too late!

混江龙づ霸主 提交于 2019-12-02 01:53:27
I have a button which when pressed makes calls that load information from a series of URLs (about 5 seconds loading time). Right before actually making those calls I want to add a "loading" alert. When I use a UIAlertView the screen dims like it's about to pop up, but it doesn't until the data is loaded - too late! I have no idea what's going on, it's like the calls I'm making to load the data are immediately taking preference over showing the new view, even though they're made right after the calls adding the new view (or showing the alert). This is a summarized version of the code: -(void)

how to add checkbox into uialertview?

不想你离开。 提交于 2019-12-02 00:57:25
I'm new in iPhone development. I want to add a check box into an alert view. I'm doing tests on this alertview for the last two days, but do not get any working demo project. I want exactly this alertbox! Can anyone help me? try this code for add checkbox in alertview . UIButton *nameField = [[UIButton alloc] initWithFrame:CGRectMake(0.0, 0, 50, 50.0)]; UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 250, 40)]; [nameField setImage:[UIImage imageNamed:@"checkbox_off.png"] forState:UIControlStateNormal]; [v addSubview:nameField]; UIAlertView *av = [[UIAlertView alloc] initWithTitle:@

Show alert view when click on a link

自古美人都是妖i 提交于 2019-12-02 00:38:42
I use formatted text in UIWebView, i have something like this: <a href="tel://0442059840">0442059840</a> I need to show alert to the user when clicking on that link using the UIAlertView for confirmation before launching the telephone call. Is this possible? Thanx in advance. Yes but you need to use undocumented method for this. Search on google or stackoverflow you will find it easily. Here is a link for helping you. http://dblog.com.au/iphone-development/iphone-sdk-tip-firing-custom-events-when-a-link-is-clicked-in-a-uiwebview/ Override the delegate method webView:shouldStartLoadWithRequest

Taking Text From a UIAlertView

北城余情 提交于 2019-12-01 22:03:07
There seems to be something missing, but the below code is generating nil values for both title and title1 (even though it launches the right alert type correctly and doesn't indicate any warning or error). What could be the problem with this implementation of UIAlertView ? UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"High Score" message:(NSString *)scoreMessage delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil]; alert.alertViewStyle= UIAlertViewStylePlainTextInput; UITextField *title1 = [alert textFieldAtIndex:0]; [alert show]; title1= [alert textFieldAtIndex:0];

Prevent AlertView from auto rotating

喜欢而已 提交于 2019-12-01 21:44:44
The launch page of my app is set to portrait only with this little bit of code: - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait ; } When the app launches a UIAlertView appears for username and password entry. The method to display it is called from viewWillAppear . This worked fine for iOS6 but since iOS7 , if I switch the device to landscape, the main view remains in portrait but the the alert view and keyboard rotate to landscape. A further bizarre quirk is that when I switch back to portrait, only the keyboard switches back (in truncated form),

UIAlertView fails to show and results in “EXC_BAD_ACCESS” error

旧城冷巷雨未停 提交于 2019-12-01 20:52:49
A method is called when a return button on the keyboard is pressed. After calling another method which returns an integer a message is created based on that integer. The message is then passed into an UIAlterView and displayed to the user. The alert doesn't have any options (hence why I'm not calling a delegate), but simply notifies the user of what happened. Edit: Below is the full method (previously displayed partial). When I comment out everything before the UIAlertView and substitute the string @"test" instead of passing message the Alert is shown successfully. Am I not handling memory

multiple UIAlertView issue

余生颓废 提交于 2019-12-01 20:00:14
I have an issue with my code, I have two blocks of code of UIAlertViews one with cancel and ok button, and the other to make a UIImagePicker -(IBAction)publicaPeticion { if([txtPeticion hasText] ) { UIAlertView *alerta = [[UIAlertView alloc] initWithTitle:@"Confirmación de Compra" message:@"Deseas comprar la petición por $12.00" delegate:self cancelButtonTitle:@"Cancelar" otherButtonTitles:@"Aceptar", nil]; [alerta show]; } } The issue is between publicaPeticion and cargaImagen -(IBAction)cargaImagen { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Subir una imagen" message:@"¿De