草庐IT

UIAlertcontroller

全部标签

ios - inputAccessoryView 与 UIAlertController 一起显示

我已经覆盖了UIViewController中的-inputAccessoryView:方法,该方法返回一个显示在键盘顶部的View,该View在编辑viewController上的UITextField时显示查看。-(UIView*)inputAccessoryView;我还从viewController中呈现了一个UIAlertController。UIAlertController*alert=[UIAlertControlleralertControllerWithTitle:@"SaveProfile"message:@"Youhavemadechangestoyourpro

ios - UIAlertController 内存泄漏

我没有使用ARC。在呈现UIAlertController时,通过Instruments测试泄漏会给我以下信息:当我检查调用树时,它似乎在提示这段代码。不确定其中有多少是相关的,但无论如何......-(void)connection:(NSURLConnection*)connectiondidFailWithError:(NSError*)error{//bunchofcode#ifndefNDEBUGNSString*err_msg=[NSStringstringWithFormat:@"%@%ld",@"Errornumber",(long)error_code];//@pro

ios - 通过点击外部关闭 UIAlertControllerStyleAlert UIAlertController

众所周知,UIAlertView现在已被弃用,Apple希望我们使用样式为UIAlertControllerStyleAlert的新UIAlertController。但是,使用UIAlertControllerStyleAlert时,您无法通过在警报View外点击来触发样式为UIAlertActionStyleCancel的UIAlertAction。有谁知道通过点击外面的警报View来关闭警报View的方法吗?干杯 最佳答案 您可以为alertViewController添加样式为UIAlertActionStyleCancel

ios - UIAlertController 显示 UIAlertActions 的空白标题

最近,我终于重构了一个遗留项目,并将所有UIAlertViews和UIActionSheets转换为UIAlertControllers。但我已经开始收到来自客户的问题,他们说有时UIAlertController操作标题是空白的。像这样:我无法在我的设备上重现此错误,您对可能的原因有任何想法吗?更新:我相信,该问题已包含在该代码中,也许主窗口的tintColor不是默认的,UIAlertController继承了它?@implementationUIAlertController(WMC)-(void)show:(BOOL)animated{self.alertWindow=[[UI

ios - 试图关闭 UIAlertController iOS 8

Crashlytics在我的应用中向我发送此错误:FatalException:NSInternalInconsistencyExceptionTryingtodismissUIAlertControllerwithunknownpresenter.UIKit-[UIAlertController_dismissAnimated:triggeringAction:triggeredByPopoverDimmingView:]+584此问题仅出现在iOS8中,但当我尝试重现此错误时,我的alertViews在iOS8中正常工作并且没有发生任何不良情况。为什么会出现这个问题?我读过在iOS

ios - 如何在 Objective C 中显示另一个之前关闭一个呈现的 UIAlertController

我想在呈现新的UIAlertController之前关闭之前呈现的UIAlertControllers。我需要从AppDelegate执行此操作。如何才能做到这一点。欢迎提出所有建议。 最佳答案 您可以找到顶部呈现的ViewController并检查它是否是UIAlertController。如果是,那么您可以对其调用dismissViewControllerAnimated:。所有这些都可以非常简单地从应用程序委托(delegate)中完成。 关于ios-如何在ObjectiveC中显

ios - 是否可以向 UIAlertController 添加超链接?

技术:Objective-C、xCode7@property(nonatomic,copy)NSString*notes;@synthesizenotes;example.notes=@"Clickhere";NSString*msg=[@""stringByAppendingFormat:@"%@",myAnnotation.notes];UIAlertController*alertViewController=[UIAlertControlleralertControllerWithTitle:@"TitleofAlertBox"message:msgpreferredStyle

ios - UIAlertController 关闭速度很慢

在iOS8之后,将我的实现更改为UIAlertController而不是UIAlertView让我有些头疼。在点击按钮后用户界面开始响应之前,解雇大约需要一整秒的时间。这意味着用户认为有问题。只有我一个人受苦吗?它跨越多个应用程序,对于像这样简单的实现来说也是如此。我在一个新的空白项目中尝试了这个。-(IBAction)showAlertView{[[[UIAlertViewalloc]initWithTitle:@"test"message:@"test"delegate:selfcancelButtonTitle:@"OK"otherButtonTitles:nil]show];}

ios - 在 UIAlertController 中禁用视差 iOS

我正在开发的应用程序仅支持纵向模式。但是,在iOS8中,现在已弃用的UIAlertView可以进入横向并显示其他一些小问题。为了解决这个问题,我决定尝试一下UIAlertController。它有效,但我有一个新问题仍然有点烦人。警报不再进入风景,但它确实具有视差运动的特点。我在UIAlertController的View中添加了一个标签和一个图像,但它们没有视差功能,这意味着当用户四处移动手机时它看起来很奇怪。我正在寻找两个选项,但找不到其中任何一个的操作方法。第一个解决方案是禁用视差功能,看看我们如何在应用程序的任何地方不支持它。第二种解决方案是为标签和图像添加视差支持。无论如何,

ios - 当我点击按钮而不是 UIAlertcontroller 时创建 Action

我为UIAlertcontroller创建两个按钮:OneButton-"OpenCamera"Twobutton-"OpenGallery"我只是不明白当我点击其中一个时我是如何创建Action的。-(IBAction)takePic:(id)sender{UIAlertController*alert=[UIAlertControlleralertControllerWithTitle:nilmessage:nilpreferredStyle:UIAlertControllerStyleActionSheet];//1UIAlertAction*openCamrea=[UIAler