iOS UIActionSheet的使用
2016-02-02 15:45
507 查看
一、初始化
二、设置代理
NSLog(@"确定注销");
}
三、效果图
- (IBAction)logout:(id)sender { UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"确定要注销?" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"确定" otherButtonTitles:nil, nil]; [sheet showInView:self.view]; }
二、设置代理
//必须要让控制器遵守UIActionSheetDelegate代理
#pragma mark - actionsheet的代理方法 - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { //通过buttonIndex的值来确定点击的是第几个 if (buttonIndex == 0){
NSLog(@"确定注销");
}
}
三、效果图
相关文章推荐
- iOS UITextField的属性、代理及通知
- UESTC(LCA应用:求两点之间的距离)
- 搜索框UISearchController的使用(iOS8.0以后替代UISearchBar + UISearchDisplayController)
- Discuz--QQ互联登陆出现(1054) Unknown column “conuintoken” in “field list”
- UILabel 设置字体间的距离 和 行与行间的距离
- Cts框架解析(8)-IBuildProvider
- 2016你一定要试试这8款原型设计工具
- Buildings
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- 模糊搜索UISearchBar
- 基于对话框的UPDATE_COMMAND_UI的响应问题
- 一張圖勝千言萬語,13 張圖徹底解釋 UI & UX 差別是什麼
- 瀑布流(UIScrollView实现)
- RMQ (Range Minimum/Maximum Query)算法
- Build模式——自由扩展
- Builder模式
- setCellValue 后面的数据被前面的数据覆盖
- UIViewController+UITableView 和 UITableViewController
- Interface Builder一些使用技巧
- iOS UITabBarController