草庐IT

uialertview

全部标签

ios - ARC 和 UIAlertView : unrecognized selector sent to instance

这是我如何显示UIAlertView和委托(delegate)clickedButtonAtIndex-UIAlertView*alert=[[UIAlertViewalloc]initWithTitle:@"title"message:@"message"delegate:selfcancelButtonTitle:@"Cancel"otherButtonTitles:@"Continue",nil];[alertshow];-(void)alertView:(UIAlertView*)alertViewclickedButtonAtIndex:(NSInteger)buttonIn

ios - 更改 UIAlertView 键盘的类型

如何将UIAlertView文本字段的键盘指定为数字键盘?我正在将alertViewStyle设置为UIAlertViewStylePlainTextInput。 最佳答案 我想你可以这样做:UITextField*tf=[alertViewtextFieldAtIndex:0];tf.keyboardType=UIKeyboardTypeNumberPad;参见UIAlertView和UITextInputTraits文档 关于ios-更改UIAlertView键盘的类型,我们在Sta

ios - UIAlertView 在 iOS 8.3 中崩溃

最近我开始收到只有使用iOS8.3的用户的UIAlertView崩溃报告Crashlytics报告:FatalException:UIApplicationInvalidInterfaceOrientationSupportedorientationshasnocommonorientationwiththeapplication,and[_UIAlertShimPresentingViewControllershouldAutorotate]isreturningYES发生崩溃的行是[alertViewshow]:UIAlertView*alertView=[[UIAlertView

ios - 带有文本字段的 UIAlertView 在 iOS 8 中不弹出键盘

这个问题在这里已经有了答案:UIAlertView'stextfielddoesnotshowkeyboardiniOS8(8个答案)关闭8年前。我有一个UIAlertView,里面有一个文本字段(UIAlertViewStylePlainTextInput),它会在iOS7中自动弹出键盘。但是,当我升级到iOS8时,键盘不会自动弹出,而是我必须点击文本字段让键盘弹出。无论如何,当我调用它时,是否可以将自动键盘弹出恢复到UIAlertView文本字段?UIAlertView*alert=[[UIAlertViewalloc]initWithTitle:@""message:@"Thea

iphone - 在 iOS 7 中将 UIAlertView 中的消息对齐到左侧

我想将UIAlertView中的消息左对齐到iOS7中的左对齐,我可以在iOS5.x和6.x中使用UITextAlignmentLeft做到这一点和NSTextAlignmentLeft而不是iOS7。 最佳答案 Sten是对的,我们无法在iOS7中自定义UIAlertView的外观,如果您需要,可以在https://github.com/wimagguc/ios-custom-alertview获取自定义警报View代码。 关于iphone-在iOS7中将UIAlertView中的消息

ios - 在不引用 iOS 7 的情况下查找 UIAlertView

我在我的项目中使用了一个代码片段,在这里回答:UIAlertViewwithouthavingreferencetoit代码如下:+(UIAlertView*)getUIAlertViewIfShown{if([[[UIApplicationsharedApplication]windows]count]==1){returnnil;}UIWindow*window=[[[UIApplicationsharedApplication]windows]objectAtIndex:1];if([window.subviewscount]>0){UIView*view=[window.sub

ios - 禁用 UIAlertView 按钮

我正在制作一个带有文本输入的UIAlertView。UIAlertView*alertView=[[UIAlertViewalloc]initWithTitle:@"Save"message:@"PleaseEntertheNameofPDF"delegate:selfcancelButtonTitle:@"Cancel"otherButtonTitles:@"OK",nil];[alertViewsetAlertViewStyle:UIAlertViewStylePlainTextInput]当UITextField为空时我想做什么我用委托(delegate)函数禁用OK按钮-(BO

cocoa-touch - iOS 中 NSErrorRecoveryAttempting、NSError 和 UIAlertView 的正确用法是什么?

我无法找到在iOS上一起使用NSError、UIAlertView和NSErrorRecoveryAttempting的正确方法示例。我能找到的大部分文档和示例涵盖了OSX上的等效功能,其中相关行为由Cocoa集成。但在iOS中,似乎有必要“手动”执行此操作,而且我找不到如何完成的好例子。我非常感谢一些使用NSError中的信息来支持从报告给用户的NSErrors恢复尝试的最佳实践示例。 最佳答案 根据Apple的文档:Important:TheNSErrorclassisavailableonbothMacOSXandiOS.Ho

ios - 有没有办法在一段时间后关闭无按钮 UIalertView?

UIAlertView*alertView=[[UIAlertViewalloc]initWithTitle:@"tittle"message:@""delegate:selfcancelButtonTitle:@""otherButtonTitles:nil];[alertViewshow];[alertViewrelease];我想在它显示一段时间后关闭alerview,但是当alertview没有按钮时,如果我调用-dismissWithClickedButtonIndex:animated:方法和-它不起作用performSelector:withObject:afterDel

ios - UIAlertView iOS 8 beta 5 中无标题的 UI 问题

我在iOS8上运行我们的应用程序时遇到与UIAlertView相关的问题。我正在显示标题为nil的警报。它在iOS7中运行良好,但现在UI看起来很奇怪。我在这里附上截图。我发现的一种解决方案是,当我提供空字符串@“”时,它看起来没问题。请参见下面的屏幕截图。但我不确定我提到的问题是否是betaiOS8版本中的错误,或者是否有其他更好的解决方案。即使有了解决方案,它也不像在iOS7中那样准确。iOS7-显示标题为nil的警报View。截图在这里。 最佳答案 在iOS8中我最接近的是设置标题而不是消息:UIAlertView*alert