jjzjj

UIAlertAction

全部标签

ios - 使用 url 方案将标记添加到 ios 中的谷歌地图

当我在我的应用程序中点击“在Googlemap中打开”按钮时,我希望我的应用程序导航到谷歌地图应用程序并打开我指定的地址并在其中放置一个标记。这是我为此目的编写的代码:UIAlertAction*googleMaps=[UIAlertActionactionWithTitle:NSLocalizedString(@"google_maps",@"GoogleMaps")style:UIAlertActionStyleDefaulthandler:^(UIAlertAction*action){NSString*customURL=@"comgooglemaps://?center=41

ios - 如何在 UIAlertController 中更改 UIAlertAction 的字体大小和颜色

上图中“Done”、“SomeOtheraction”如何改变字体大小和颜色?以及如何更改“title”和“message”的字体大小和颜色?谢谢。 最佳答案 这是来自另一个堆栈溢出帖子,但似乎工作正常。Postfoundhere.UIAlertController*alertVC=[UIAlertControlleralertControllerWithTitle:@"Dontcarewhatgoeshere,sincewe'reabouttochangebelow"message:@""preferredStyle:UIAler

ios - 如何在 UIActionsheet 的按钮上添加复选标记,我可以在 iphone 中创建刻度标签?

我想弄清楚如何在UIActionSheet中的按钮右侧添加复选标记。有没有一种安全的方法可以在UIActionSheet的按钮中添加这个复选标记?有没有更简单的方法在不使用OfPrivateapi的情况下在UIActionsheet的按钮中添加复选标记? 最佳答案 从iOS8.0开始,您可以使用UIAlertController。在UIAlertController中,每个按钮项都被称为UIAlertAction,它会相应地添加。UIAlertAction包含一个名为image的运行时属性,您可以根据需要进行设置。UIAlertAc

ios - 以编程方式触发 UIAlertController 的 UIAlertAction

我想在我的应用程序进入后台时通过单击“取消”按钮关闭我的UIAlertController。我已经设置了后台通知[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(appDidEnterBackground)name:UIApplicationDidEnterBackgroundNotificationobject:nil];然后在我的appDidEnterBackground函数中我有:-(void)appDidEnterBackground{if(_alertController){UIAle

ios - WKWebView completionHandler 在解雇前调用

我正在使用WKUIDelegate这个函数来处理javascript警报-(void)webView:(WKWebView*)webViewrunJavaScriptAlertPanelWithMessage:(NSString*)messageinitiatedByFrame:(WKFrameInfo*)framecompletionHandler:(void(^)(void))completionHandler{UIAlertView*alert=[[[UIAlertViewalloc]initWithTitle:NSLocalizedString(@"TestAlert",nil

ios - 如何执行 UIAlertAction 的处理程序?

我正在尝试编写一个帮助程序类,让我们的应用程序支持UIAlertAction和UIAlertView。但是,在为UIAlertViewDelegate编写alertView:clickedButtonAtIndex:方法时,我遇到了这个问题:Iseenowaytoexecutethecodeinthehandlerblockof一个UIAlertAction。我试图通过在名为handlers的属性中保留一组UIAlertAction来实现这一点@property(nonatomic,strong)NSArray*handlers;然后像这样实现一个委托(delegate):-(void

ios - 如何根据 UIAlertController 中的 UITextField 禁用 UIAlertAction?

我正在使用UIAlertController向用户显示一个对话框以输入5位数的CRN。我希望Add按钮被禁用,直到UITextField中有五个且只有五个数字。这是用户界面的样子:以下是为UIAlertController设置的属性:varalertController:UIAlertController!varaddAlertAction:UIAlertAction!{returnUIAlertAction(title:"Add",style:.default)}下面是我如何在viewDidLoad方法中初始化它们:self.alertController=UIAlertContro

ios - Objective-C - 我希望 UIAlertController 在单击按钮时不被删除

我想展示一个带有2个按钮的UIAlertController。一个按钮应该关闭警报,第二个按钮应该执行一个操作但在屏幕上保持警报。是否有一些配置可以完成它不会关闭警报的操作?UIAlertController*alert=[UIAlertControlleralertControllerWithTitle:@"title"message:@"message"preferredStyle:UIAlertControllerStyleAlert];[alertaddAction:[UIAlertActionactionWithTitle:@"DoSomething"style:UIAler

swift - accessibilityPerformEscape 不会关闭 UIAlertController

我正在尝试显示UIAlertContoller并在VoiceOver用户执行滑动手势时关闭它:overridefuncaccessibilityPerformMagicTap()->Bool{showPopup()returntrue}overridefuncaccessibilityPerformEscape()->Bool{print("close")returntrue}funcshowPopup(){baseAlert=UIAlertController(title:"Popup",message:"Chooseanoption",preferredStyle:.Alert)l

swift - 在 Swift 中制定隐私政策 : How to make UIAlertController action button disabled until message is scrolled to the bottom

在我的iOS应用程序中,我尝试使用UIAlertController实现一个简单的隐私策略。根据法律,该政策在被接受之前必须是可滚动的——就像当今大多数隐私政策一样。根据我自己的研究,我发现您可以禁用和启用UIAlertAction按钮,但我不知道如何识别UIAlertController消息正文何时滚动。一直滚动到底部可能是一项要求,我有兴趣找出一种同样可行的方法。这是我当前为上面的默认外观UIAlertController编写的代码。letalertController=UIAlertController(title:"PrivacyPolicy",message:privacyP