问题标签 [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 投票
1 回答
1107 浏览

ios - 使用 UIAlertAction 执行 segue

我想让“下一步”按钮执行 segue 以移动到“个人信息”(一个 UIViewController)

但是我得到一个带有代码的“信号 SIGABRT”。我该如何解决它?

0 投票
1 回答
169 浏览

ios - 将 prepareForSegue 添加到 UIAlertAction

ViewController当按下警报视图中的“下一步”按钮时,我想将一个数组传递给另一个数组。

这是perpareForSegue

我想把perpareForSegue进入“下一步”按钮。我应该如何修改我的代码..我找不到其他类似的问题...

0 投票
2 回答
4073 浏览

swift - 如何在 UIAlertController 中更改一种 UIAlertAction 文本颜色

如何更改 UIAlertController 中一个 UIAlertAction 而不是所有操作按钮的文本颜色。

这是我的 UIAlertController 代码:我想将 Delete UIAlertAction 文本颜色更改为红色。

0 投票
1 回答
124 浏览

swift - Swift - 存储 UIAlterController 文本值

(使用 Swift 2 和 Xcode 7)

我有一个 UIAlertController 提示用户输入名称。

我很难获得用户输入的价值,所以任何提醒都会很棒。

我有以下代码;

0 投票
1 回答
506 浏览

ios - UIAlertController 中的键盘延迟关闭

我正在尝试在UIAlertController. 这是我的代码:

问题在于取消 UIAlertAction。当我按下此操作时,键盘会延迟一段时间消失。不是同时UIAlertController。有什么问题?

我正在使用 pod FFGlobalAlertController这里有一些例子

0 投票
3 回答
2497 浏览

ios - 在 UIAlertController 的文本字段中选择文本

我需要在 UIAlertController 出现后立即选择文本字段的文本。但是,我在标准 UITextField 中选择文本的方式在这里不起作用。

这是我尝试过的,但我似乎无法让它发挥作用。

有任何想法吗?

0 投票
4 回答
6059 浏览

swift - Trigger UIAlertAction on UIAlertController programmatically?

There are a couple of existing questions on this topic but they aren't quite what I'm after. I've written a little Swift app rating prompt for my app which presents two UIAlertController instances, one triggered by the other.

I'm now trying to unit test this, and trying to reach that second alert in the tests. I've written a simple spy to check the first controller, but I'd like a way to trigger one of the actions on the first alert, which in turn shows the second.

I've already tried alert.actions.first?.accessibilityActivate(), but it didn't seem to break inside the handler of that action – that's what I'm after.

0 投票
3 回答
1154 浏览

ios - 尝试呈现其视图不在窗口层次结构中

我正在使用 ResearchKit 开展一个项目,因此我将用户发送到我创建的任务中:

当用户完成调查后,他进入:

... }

在这里我尝试之前显示警报时遇到问题

我收到以下错误:

尝试在 ViewController: ... 上呈现 UIAlertController: ... 其视图不在窗口层次结构中

知道如何在关闭 ViewController 之前显示警报吗?

我使用以下警报:

编辑:代码如下:

0 投票
2 回答
2204 浏览

ios - 显示 AlertView 后从 Function 返回 Bool 值

我可以选择基本上在我的应用程序中打印文档。现在不允许打印一些文档(除非指定标准)。所以我正在使用代表。

请注意,我同时使用Objective CSwift

基本上我的打印代码如下:

现在Swift,我基本上需要做的是与用户确认他们是否要继续打印文档。所以,我使用一个UIAlertController.

问题是我如何从这个警报视图返回一个布尔值。

0 投票
1 回答
292 浏览

ios - 如何在 UIAlertController 的 UIAlertAction 的处理程序中更改全局值(添加函数)?

我想显示一个警报,我做到了。但是有一个问题:我无法更改全局值或在 的处理程序中添加UIAlertAction函数UIAlertController。例如:

我添加了ofself.appDelegate.globalvalue = true的处理程序,但值始终为 false...未更改为 true...UIAlertActionUIAlertControllerself.appDelegate.globalvalueself.appDelegate.globalvalue

如何更改 of 的处理程序中的UIAlertActionUIAlertController?或者我可以在警报上单击“确定”后更改全局值吗?谢谢你的一切:)