Tag: uialertview

在iOS7中更改UIAlertView的字体大小

我想在alertView中更改消息文本和标题文本的字体大小。 在苹果网站上没有关于此的文档,但是苹果在他们的子类注释中说“UIAlertView类是为了原样使用”。 请参考下面的链接。 https://developer.apple.com/library/ios/documentation/uikit/reference/UIAlertView_Class/UIAlertView/UIAlertView.html 如果更改警报视图文本大小是要避免的或可以更改的,我真的很困惑吗? 任何人都可以告诉我什么是这个最好的做法? 如果文本大小可以改变,你是否也可以提供一些方法来做到这一点?

在一段时间后显示UIAlertView

我试图显示一段时间后UIAlertView(如在应用程序中做了5分钟后)。 我已经通知用户,如果应用程序closures或在后台。 但是我想在应用程序运行时显示一个UIAlertView。 我试图dispatch_async如下,但警报是永远popup: [NSThread sleepForTimeInterval:minutes]; dispatch_async(dispatch_get_main_queue(), ^{ UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"title!" message:@"message!" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; [alert show]; [alert release]; } ); 另外,我读了30到60分钟后线头死亡。 我希望能够在超过60分钟后显示警报。

在asynchronousHTTP请求的completionHandler中更新视图时延迟

在我的应用程序中,当用户按下一个button时,我开始一个HTTPasynchronous请求(使用[NSURLConnection sendAsynchronousRequest…] ),并在completionHandler块中更改UILabel的文本。 然而,这一变化在请求结束时不会发生,而是在2-3秒后发生。 下面是导致这种行为的代码片段。 – (IBAction)requestStuff:(id)sender { NSURL *url = [NSURL URLWithString:@"http://stackoverflow.com/"]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; NSOperationQueue *queue = [[[NSOperationQueue alloc] init] autorelease]; [NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler: ^(NSURLResponse *response, NSData *data, NSError *error) { NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; exampleLabel.text = [NSString stringWithFormat:@"%d", httpResponse.statusCode]; }]; } 当我尝试在completionHandler创build一个UIAlertView时,会发生类似的行为。 – (IBAction)requestStuff:(id)sender { NSURL *url = […]

检查UIView是否显示UIAlertView

是否有可能确定当前的UIView是否显示了UIAlertView(除了每次创buildUIAlertView时设置一个variables)。 我正在思考一些问题 if ([self.view.subviews containsObject:UIAlertView]) { … } 但是,这显然是行不通的。

将UIDatePicker添加到UIAlertView

我正在尝试添加dateselect器到警报视图。 我可以添加animation到屏幕基于一个button点击,我看到一个黑匣子,但没有dateselect器。 这是我到目前为止…. – (IBAction)showDatePicker { CGRect frame = CGRectMake(200, self.view.frame.size.height, self.view.frame.size.width, 0); //CGRectMake(225, 145, 260, 125); UIPickerView *datePicker = [[UIPickerView alloc] initWithFrame:frame]; UIAlertView *showDateAlert = [[UIAlertView alloc] initWithTitle:@"Enter the Code Date" message:@"Sample message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Update", nil]; [self.view addSubview:datePicker]; [UIView beginAnimations:@"slideIn" context:nil]; [datePicker setCenter:CGPointMake(datePicker.frame.origin.x, self.view.frame.size.height – datePicker.frame.size.height/2)]; [UIView commitAnimations]; } 我发现一个似乎工作的例子,但我没有看到任何对话框或button在我的警报框,只是dateselect器本身。 我在这里错过了什么? – (IBAction)showDatePicker […]

旋转UIAlertView

我创build了一个自定义的UIAlertView(通过inheritance它的子类和它的show函数),它有一些自定义的子视图,并且是非标准的大小。 当我创build并显示它时,它工作正常,但是,当设备旋转时,警报会旋转,然后返回到其默认大小。 任何想法什么function重写 – 或者我应该调整UIViewController? 谢谢,彼得

带有两个TextFields和两个button的UIAlertView

问题 – 我想要一个UIAlertView包含一个标题,两个带占位符和两个button的文本框。 到目前为止我所做的 – 我已经使用这个代码,我得到了所有这些我已经提到的确切的UIAlertView,但是当视图被加载时,似乎出现在底部的第一个,然后进入视图的中间。 -(void)showalert{ disclaimerAgreedAlertView = [[UIAlertView alloc] initWithTitle:@" " message:@" " delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Login", nil]; userNameTextField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 15.0, 245.0, 25.0)]; userNameTextField.delegate=self; [userNameTextField setBackgroundColor:[UIColor whiteColor]]; [userNameTextField setKeyboardType:UIKeyboardTypeDefault]; userNameTextField.placeholder=@"Username"; userNameTextField.secureTextEntry=NO; [disclaimerAgreedAlertView addSubview:userNameTextField]; passwordTextField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)]; passwordTextField.delegate=self; [passwordTextField setBackgroundColor:[UIColor whiteColor]]; [passwordTextField setKeyboardType:UIKeyboardTypeDefault]; passwordTextField.placeholder=@"Password"; passwordTextField.secureTextEntry=YES; [disclaimerAgreedAlertView addSubview:passwordTextField]; […]

iOS 8:UIAlertView / UIAlertController不显示文本或button

我有一个UIAlertView在iOS 7中完美显示,但在iOS 8中,它不显示任何button或标签。 警报仍然可见,但只是一个小白盒子。 “确定”和“取消”button也将其事件作为参考,但不会显示任何文本。 我已经使用这个警报来显示一个button – (IBAction)sel_btnLogout:(id)sender { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Logout!" message:@"Are you sure you want to logout?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil]; [alert show]; } 我在iOS 8中检查了框架:它给(0,0,0,0),但在iOS 7中给出了一个确定的值。 我也检查了迭代到uialertview的子视图。 在iOS7中,它进入循环,因为它发现警报的子视图。 在iOS8中,它表示没有alertView的子视图。

要在UIAlertView上显示UIProgressView

嗨,大家好,我想在UIAlertView显示UIProgressView显示文件的上传处理,但我已经search了太多,也find了该链接,但基层无法做到这一点。 我不明白这一点 如果有人知道最简单的方法,那么请让我知道。 我会很感激。

'加载UIAlertView(iOS)时'wait_fences:收到回复失败:10004003'

当我调用UIAlertView时,我得到了'wait_fences:未能接收到回复:10004003'。 这是应用程序第一次打开时调用。 它不会崩溃的应用程序或似乎影响它的function,但我想完全清理我的应用程序。 这是一个标签栏应用程序,我已经在View Controller的viewDidLoad部分input了代码,该部分首先在app中加载: – (void)viewDidLoad { [super viewDidLoad]; UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Welcome!" message:@"Thanks for downloading our new app! \n \n Take a look around and if you have any questions, don't hesitate to contact us." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [alert show]; [alert release]; } 我已经看到了这个错误的网站上的其他答案,但他们似乎处理UITextFields,我不知道他们是如何适用于我的情况。 我很抱歉,如果我错过了简单的东西,但我正在学习动手,似乎无法弄清楚这一个。 谢谢!