计算后,我想显示一个弹出窗口或警报框,向用户传达消息。有谁知道我在哪里可以找到有关此的更多信息?
Yup, a UIAlertView
可能就是您正在寻找的。这是一个例子:
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
,你可以子类化UIAlertView
并将自定义 UI 组件放入init
方法。如果您想在一段时间后响应按钮UIAlertView
出现后,您可以设置delegate
以上并实施- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
method.
您可能还想查看UIActionSheet
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)