uialertview

UIAlertView Strange Behaviour with Shortcut Control center

空扰寡人 提交于 2019-12-24 13:54:06
问题 i am facing the problem with the UIAlertview behaviour,i Know when alertview is raised except the external controls all the controls will get inactive. My app on of the functionality will work only on airplain mode,My client wanted to use the control center to enable airplain mode.In my appUntil unless user activating the airplain mode Alertview will keep raise. But for the first Alert display i am unable to open the shortcut control center.If i hit okey without activation then app waill

Redirect to notification setting directly from iOS app that having support of iOS8+

99封情书 提交于 2019-12-24 12:38:06
问题 My requirement is that - if notification for the app is turned off by user and user opens the app at that time it will give alert for turn on notification for the app and when click on okay button of alert view app will redirect to notification screen where user need to click on switch button only to turn on the notifications. Is it possible in ios8+ ? I want to redirect this screen Thanks 回答1: This code will redirect you to setting of notifications. if ([[UIApplication sharedApplication]

Edit annotation text with an UIAlertViewStylePlainTextInput

孤街浪徒 提交于 2019-12-24 11:43:51
问题 I can drop pin annotations onto a map which has a disclosure button. When that button is clicked an alertView pops up in which I can remove the selected annotation. I am now trying the edit the selected annotation subtitle with UIAlertViewStylePlainTextInput. Any ideas on how I can do this? - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control { NSLog(@"Annotation button clicked"); UIAlertView * alert = [[UIAlertView

iPhone SDK: how to get the value of a UITextField in an alert?

情到浓时终转凉″ 提交于 2019-12-24 07:45:36
问题 I'm really new at this. I've been working my way through a couple of "HelloWorld" type tutorials that basically have a text field, a button, and when you click the button it alerts whatever's in the text field. I've gotten as far as getting an alert to show and being able to set the title, message, and button text directly. However my attempts at getting the contents of my UITextField keep failing. I either get errors, no response, or just "(null)". My code's here. @synthesize textField; -

关于iOS 7以后自定义UIAlertview(CustomIOS7AlertView)的用法心得

不问归期 提交于 2019-12-24 05:25:59
公司项目要求更新的提示框上要加明更新的内容,如下图所示: 但是用系统自带的UIAlertview 却偏偏成为了这个样子! 不对称很难看有木有! 故从网上搜寻如何能使message的text左对齐 找到如下: http://blog.csdn.net/andypan1314/article/details/8246407 经调试,发现根本在iOS 8 上不起作用(实际上7.0以后都不起作用) 于是乎决定采用自定义的方式来构建这个提示框,然后去github上去搜了搜,发现了CustomIOS7AlertView 这个第三方的定制控件,地址如下: https://github.com/wimagguc/ios-custom-alertview 运行demo发现,这个能够自己定制alertview上的containerView来实现自己想要的效果。 但是我发现他的按钮跟按钮直接是没有那根分割线的,如下图: 这样就有点太难看了,所以我对他的源代码,做了一些修改,在 CustomIOS7AlertView.m 中找到 这个方法添加如下几行代码(颜色粗细自己写) 再运行下demo试试,就变成了这个样子: 接下来就是嵌入到公司项目中去了,我的思路就是把“提示的title”还有“主title”跟 “更新信息” 放到一个view 上 然后用 方法来显示 具体用法如下: 先导入文件 到工程中

How to multithred correctly? UIAlertView is not displayed, only gray screen

筅森魡賤 提交于 2019-12-24 02:59:10
问题 i have implemented textToSpeech in my project and want to display an alertview while text is spoken. here i am calling the methods for textToSpeech: //-----before TTS starts i try to display alertView with Cancelbutton //[self performSelectorOnMainThread:@selector(alertWhileTTS) withObject:nil waitUntilDone:YES]; //gray view and no alertview //[self performSelector:@selector(alertWhileTTS)]; //gray view and no alertview //[self alertWhileTTS]; //gray view and no alertview //this part here is

access an alertView's calling view

十年热恋 提交于 2019-12-24 01:56:04
问题 I have a UIAlertView which appears as a confirmation when a user wants to delete a RegionAnnotation. I'm having trouble figuring out how to access the RegionAnnotationView that called the UIAlertView which I need in order to delete the RegionAnnotation. Here's my broken code - you can see where I'm trying to cast the AlertView's superview into a RegionAnnotationView (an admittedly bad idea). - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if

How to limit character input in UIAlertView UITextField

自闭症网瘾萝莉.ら 提交于 2019-12-23 20:18:23
问题 I am trying to limit the number of characters my user is allowed to input into my UITextField within my UIAlertView . I've tried the some common answers on the web. Such as shown below : #define MAXLENGTH 10 - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { if ([textField.text length] > MAXLENGTH) { textField.text = [textField.text substringToIndex:MAXLENGTH-1]; return NO; } return YES; } Anyone able to help? 回答1: .h

How to add UITableView in a UIAlertView in swift

浪子不回头ぞ 提交于 2019-12-23 19:28:49
问题 How do I dynamically add UITableView in UIAlertView. After adding subView of UIAlertView to UITableView it is not displayed. override func viewDidLoad() { super.viewDidLoad() tableView.frame = CGRectMake(0, 50, 320, 200); tableView.delegate = self tableView.dataSource = self tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell") } @IBAction func textFieldCliked(sender: AnyObject) { alertView.message = "table view" alertView.addButtonWithTitle("Ok") alertView.addSubview

Displaying alert from app delegate before displaying alert from viewDidload

旧街凉风 提交于 2019-12-23 11:57:43
问题 I am attempting to display the message contained within a push notification through the app delegate as outlined in the parse.com documentation. The problem I am having is that in my viewdidload method for my first view controller, i am presenting an alert which the user MUST see before they use the app. How can I call the method from my app delegate after the user sees the Alert from the viewdidload method? EDIT: So i have, as suggested in the comments, added a global Variable which i set to