Tag: uialertview

进入后台状态时closuresUIAlertViews

Applebuild议在iOS 4中进入后台状态时解除任何UIAlertViews/UIActionSheets 。这是为了避免在稍后重新启动应用程序时对用户造成任何混淆。 我不知道如何能够一次优雅地解除所有UIAlertViews,而不会保留每次我设置一个参考它… 任何想法 ?

iOS UIAlertViewbutton去设置应用程序

有没有办法让UIAlertView的button进入设置应用程序为特定的应用程序调用它? 谢谢

如何使用活动指示器显示alertview?

我想显示alertview消息:“加载数据”和旋转活动指示器。 我怎样才能做到这一点?

AlertController不在窗口层次结构中

我刚刚创build了一个ViewController类的单一视图应用程序项目。 我想从位于我自己的类中的函数显示一个UIAlertController。 这是我的class级警报。 class AlertController: UIViewController { func showAlert() { var alert = UIAlertController(title: "abc", message: "def", preferredStyle: .Alert) self.presentViewController(alert, animated: true, completion: nil) } } 这是执行警报的ViewController。 class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } @IBAction func showAlertButton(sender: AnyObject) { var alert = AlertController() alert.showAlert() } } 这是我得到的,而不是美丽的戒备。 警告:尝试在Sprint1.AlertController上显示UIAlertController:0x797d2d20:0x797cc500其视图不在窗口层次结构中! 我该怎么办?

UIAlertView首先不赞成使用IOS 9

我已经尝试了几种使用UIAlertController而不是UIAlertView的方法。 我尝试了几种方法,但无法使警报操作起作用。 这里是我的代码在IOS 8和IOS 9中正常工作,但显示不赞成使用的标志。 我尝试了下面的优雅build议,但是我不能在这方面使它起作用。 我需要提交我的应用程序,这是最后要解决的问题。 感谢您的任何进一步的build议。 我是一个新手。 #pragma mark – BUTTONS ================================ – (IBAction)showModesAction:(id)sender { NSLog(@"iapMade: %d", iapMade3); // IAP MADE ! =========================================== if (!iapMade3) { //start game here gamePlaysCount++; [[NSUserDefaults standardUserDefaults]setInteger:gamePlaysCount forKey:@"gamePlaysCount"]; NSLog(@"playsCount: %ld", (long)gamePlaysCount); if (gamePlaysCount >= 4) { UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Basic" message: THREE_PLAYS_LIMIT_MESSAGE delegate:self cancelButtonTitle:@"Yes, please" otherButtonTitles:@"No, thanks", […]

如何添加UIAlertView iOS 7内的子视图?

我在iTunes Store上有一个应用程序,在UIAlertView上显示一些UILabel和UIWebView 。 根据会话video, UIAlertView addSubView将不起作用。 他们谈到了ContentView 。 但在通用种子SDK中,我找不到那个属性,似乎没有别的办法。 我唯一能做的就是创build一个UIView的自定义子类并使它像UIAertView一样UIAertView 。 你能build议任何其他简单的解决scheme? 谢谢您的帮助。

在iPhone中将UIViewController显示为Popup

由于对这个常见问题没有完整的,明确的答案,我会在这里提出并回答。 通常我们需要提供一个UIViewController ,它不能覆盖整个屏幕,如下图所示。 苹果提供了几个类似的UIViewController ,比如UIAlertView ,Twitter或者Facebook共享视图控制器等等。 我们如何才能达到这个自定义控制器的效果?

如何将UITextView插入iOS中的UIAlertview

另外,我想这个UITextView与XXX.txt中的文本文件。它在i​​OS6中工作正常,但内容不出现在iOS7的UIAlertview。 我的代码如下: UITextView *tosTextView = [[UITextView alloc]initWithFrame:CGRectMake(12, 48, 260, 140)]; NSString *path = [[NSBundle mainBundle] pathForResource:@"TJTermsof Service" ofType:@"txt"]; NSString *content = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:NULL]; [tosTextView setText:content]; tosTextView.textColor=[UIColor blackColor]; tosTextView.font = [UIFont fontWithName:@"LuzSans-Book" size:17]; tosTextView.editable = NO; customAlert = [[UIAlertView alloc]initWithTitle:@" TOS \n\n\n\n\n\n " message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"I Agree",nil]; [customAlert addSubview:tosTextView]; [customAlert show];

如何以编程方式从UITextField禁用复制粘贴选项

我正在做一个注册alertview有一个UITextField在用户可以input他们的注册号码。 一切都非常他们,但是我想从编程的文本域中删除复制粘贴function,因为他们是没有InterfaceBuilder版本的文本域我不知道如何做到这一点.. 这里是我的UIalertview到目前为止… – (void)pleaseRegisterDevice { UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Please Register Device!" message:@"this gets covered" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil]; regTextField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)]; [regTextField setBackgroundColor:[UIColor whiteColor]]; regTextField.textAlignment = UITextAlignmentCenter; [myAlertView addSubview:regTextField]; [myAlertView show]; [myAlertView release]; }

UIAlertView addSubview在iOS7中

在iOS7中,使用addSubview方法不推荐添加一些控件到UIAlertView 。 据我所知苹果承诺添加contentView属性。 现在iOS 7发布了,我发现这个属性没有添加。 这就是为什么我search能够添加进度条到这个alertView的一些自定义的解决scheme。 比如类似TSAlertView的东西,但是更适合在iOS 7中使用 。