问题标签 [alertview]

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 投票
5 回答
17133 浏览

iphone - 如何在 iPhone 的 UIAlertView 中添加 UITableView?

我想UITableView在警报视图中添加。

我试图添加一个表格视图作为警报视图的子视图,它不起作用。你能给我一些代码或示例链接吗?

我怎样才能做到这一点?

0 投票
2 回答
2076 浏览

iphone - Xcode:带有文本框的 If 语句

所以我有问题这样做。这段代码不会按我想要的方式工作。

我的问题是文本框“答案”中有文本“文本”,它不会执行第一个 UIAlertView。它总是执行 else{} 中的那个。此代码也在按钮的 IBAction 中。现在任何帮助都是好的。

0 投票
4 回答
4046 浏览

ios - UIAlertView in appdelegate.m does not work

I have been googling this problem for almost a whole day now, without getting any closer to a solution, so i would like to ask you guys.. :)

I'm working on an iOS app, which should connect to a mbed over WiFi and give the user a dialog if it connects and if it doesn't and if not, then give the user the possibility to retry. My problem is now that i have implemented the connecting method in appdelegate.m and it is from here I would like to show the alerts..

The alerts it self works fine, but I have problems detecting when a button is pressed, the clickedButtonAtIndex is not being called.

I have added the UIAlertViewDelegate in the appdelegate.h, like so:

and have set the delegate to self, in the alertview, like so:

and the clickedButtonAtIndex looks like

}

So I would love to see the word "test" in the log when a button is pressed in the alertview, but nothing happens.

Update: Tried implementing it in my "FirstViewController.m" and there it works :S but I would very much like to have it in the appdelegate.m if possible..

0 投票
2 回答
420 浏览

ios - 带有 UITextField 的 UIAlertView - 使用 NSUserDefaults 保存

在我的 ViewDidLoad 的 .m 文件中,我有以下代码:

正如你所看到的,用户可以在这里保存他的名字,这样他就不必一遍又一遍地输入它。除此之外,他不会再被问到是否输入了它。但是,该应用程序在加载时不显示名称,而是显示数字 1。我想我在这里遗漏了明显的内容。

0 投票
1 回答
305 浏览

iphone - 检测摄像头并使用警报视图

我正在尝试检测 iOS 设备是否有摄像头。我知道有办法检测,但我需要帮助发出警报,如果没有摄像头,它会提醒用户。

这是我的代码....它在哪里拍照

0 投票
1 回答
4002 浏览

xcode - 带有视图控制器的 Xcode 和 alertview

我想要实现的是在单击警报视图按钮时转到另一个视图。我的警报视图在我的 loadingView 中,这个警报视图是从另一个名为 classA 的类中调用的。

这就是它在 A 类中的调用方式。

这是 loadingView 类的 loadingView 中的方法。

按钮动作

这给了我一个错误。'应用程序试图在其自身上呈现模态视图控制器。呈现控制器是 UINavigationController:..

注意:我的方法是'+'

0 投票
1 回答
94 浏览

ios - 在 AlertView 中单击“登录”按钮后,尝试转换到新的 UIView

我已经搜索了允许我在单击警报视图上的按钮后转移到新页面的方法。我必须使用 prepareForSegue 方法吗?或者有没有更简单的方法?

0 投票
2 回答
597 浏览

xcode - 在 Xcode 中将多个警报添加到单个警报视图

首先,我对 xcode 相当陌生。我正在尝试将多个警报添加到单个视图。我正在为 ipad 创建一个表单,允许用户在文本框中输入信息。由于需要填写多个文本框,我不希望弹出多个警报框来显示每个错误,而是希望一个警报视图显示多个错误。下面的注释代码是我想象中的写法

}

*是否可以在消息之前和之后放置 if 语句才能做到这一点?

0 投票
3 回答
3264 浏览

ios - 验证 uialertview 中的文本字段

UIAlertViewUIAlertViewStylePlainTextInput风格展示。然后我尝试验证这样的空字段:

但即使文本字段不为空,它也会在日志中显示一条错误消息。

0 投票
1 回答
1560 浏览

iphone - 身份验证挑战

我尝试使用 webview 访问受保护的 web 文件夹。使用“硬编码”用户并通过它可以工作,但我的计划是弹出一个警报视图以输入用户并通过。这是代码的一部分:

谁能告诉我如何调用 handleAuthenticationOKForChallenge 我对 NSURLAuthenticationChallenge 有点困惑......