作者:朱克锋
邮箱:zhukefeng@iboxpay.com
转载请注明出处:http://blog.youkuaiyun.com/linux_zkf
实例截图

@interface TestViewController : UIViewController <UIAlertViewDelegate>
@end
@implementation TestViewController
- (void) alertView:(UIAlertView *) alertView clickedButtonAtIndex: (int) index
{
printf("User selected button %d\n", index);
[alertView release];
}
- (void) showAlert: (NSString *) message
{
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"ZHUKEFENG" message:message delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"ZHU", @"KE", @"FENG", nil];
av.tag = MAIN_ALERT;
[av show];
}
- (void) action: (id) sender
{
[self showAlert:@"ZHUKEFENG Test Alert"];
}
本文提供了一个UIAlertView在iOS应用中使用的具体示例。通过该示例,读者可以了解到如何创建并显示一个包含多个按钮的警告视图,并能掌握如何处理用户点击不同按钮后的响应动作。
479

被折叠的 条评论
为什么被折叠?



