问题描述
计算后,我想显示一个弹出框或警告框,向用户传达消息.有谁知道我在哪里可以找到有关这方面的更多信息?
After a calculation, I want to display a pop up or alert box conveying a message to the user. Does anyone know where I can find more information about this?
推荐答案
是的,UIAlertView 可能就是您要找的.这是一个例子:
Yup, a UIAlertView is probably what you're looking for. Here's an example:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"No network connection"
message:@"You must be connected to the internet to use this app."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
如果你想做一些更花哨的事情,比如在 UIAlertView 中显示自定义 UI,你可以继承 UIAlertView 并在 中放入自定义 UI 组件初始化 方法.如果要在 UIAlertView 出现后响应按钮按下,可以设置上面的 delegate 并实现 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 方法.
If you want to do something more fancy, say display a custom UI in your UIAlertView, you can subclass UIAlertView and put in custom UI components in the init method. If you want to respond to a button press after a UIAlertView appears, you can set the delegate above and implement the - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex method.
您可能还想查看 UIActionSheet.
这篇关于iOS中如何实现弹出对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)