问题标签 [uialertaction]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2784 浏览

ios - UIAlertController 按钮位置不一致

警报显示:
iOS 8.1 iPod touch: [确定] [取消]
iOS 8.3 iPhone 6 Plus: [取消] [确定]

为什么按钮的位置与 iPod 和 iPhone 不同?

0 投票
2 回答
5633 浏览

ios - UIAlertAction 值列表

我试图弄清楚如何更改 UIAlertAction 标题的字体类型。我假设,可以通过为特定键设置一个值来完成。例如,要设置图像,您可以这样做:

是否有所有可用密钥的列表?我不知道使用哪个键来更改字体、左/右对齐标题等...

0 投票
1 回答
2453 浏览

swift - 使用 alert.addAction 使用未解析的标识符

我的 alert.addAction() 出现错误。好像我的项目不知道在哪里可以找到它,对吗?

我做了一个没有按钮的警报,现在我正在尝试向它添加按钮。

所以这是我的警报窗口和添加按钮的代码:

我制作了一个名为 AlertController 的 UIAlertAction,并带有一些代码来制作按钮。

但它似乎不知道在哪里寻找我想。我在这里做错了什么?

0 投票
1 回答
396 浏览

ios - Objective-C UIAlertAction

我正在尝试向 UIAlertAction 添加一个可以直接打开蓝牙设置的操作。

目前我可以打开设置,但是任何人都可以帮我将操作从“打开设置”更改为“打开蓝牙设置”吗?

谢谢

0 投票
1 回答
6773 浏览

ios - 在 iOS 的 UIAlertController 中添加自定义视图

我使用下面的代码来显示带有 Tweet、Facebook 和 Cancel 按钮的操作表。

截屏

现在,我想在操作表的每个元素上添加自定义视图,即徽标 + 推文。

所需的屏幕截图

如何实施?

0 投票
0 回答
175 浏览

xcode - Swift 1.2 - 由于信号而导致命令失败:分段错误:11

我刚刚更新到 Xcode 6.3,我必须更新我的代码才能使用 Swift 1.2。看起来我的所有代码都是最新的,但是,当涉及到UIAlertAction's 时,我的编译器会感到困惑。

在此处输入图像描述

有任何想法吗?

0 投票
1 回答
116 浏览

ios - @IBAction 递归调用

我只是想就递归调用 IBAction 函数是否有任何不可预见的问题获得第二意见。我问这个问题是因为曾经发生过一次崩溃,我发现它很难复制。

假设我们有这个电话:

这是@IBAction在 Swift 中递归调用的正确方法吗?

0 投票
0 回答
291 浏览

ios - 向 UIAlertAction 添加参数

我在单独的文件中有 2 个类:让我们称它们为 NotificationManagement 和 NotificationReceiver

在我的 NotificationReceiver 类中,我有以下代码:

现在我想把这个通知的处理放在 NotificationManagement 类而不是 NotificationReceiver 类中。但是,如果我确实把它放在那里,我需要在处理程序中使用类似的东西,以传递有关当前视图控制器的信息:

但是后来我无法编译,并且错误确实具有误导性,例如编译器找不到样式 .Default (这是因为我向 showNotificationHandler 添加了参数)。我想像这样使用 NotificationReceiver 中的函数:

0 投票
3 回答
1562 浏览

ios - How to present UIAlertController from SKScene

I'm working in Spritekit and I'm trying to present a UIAlertController from my SKScene, but I am having trouble doing it. I've watched several tutorials but none of the UIAlertController tutorials have been specific to Spritekit. I keep seeing this code below, but it has not been effective since SKScene is not a UIViewController.

I have the rest of the relative code below. Can anybody please help me present my UIAlerController on my SKScene.

0 投票
2 回答
1876 浏览

ios - Swift:单击时更改 UIAlertAction 标题

如何self从 UIAlertAction 中引用?

我希望 UIAlertAction 的标题在单击时更改(以及其他内容)。如何在命令中引用自己单击时要执行的操作?

如何使它在单击 UIAlertAction 时不会关闭警报操作