//
// UIActionSheetViewController.m
// AppUI组件学习
//
// Created by 麦子 on 15/6/18.
// Copyright (c) 2015年 麦子. All rights reserved.
//
#import "UIActionSheetViewController.h"
@interface UIActionSheetViewController ()
@end
@implementation UIActionSheetViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor blackColor];
[self createView:self.view];
}
- (void)createView:(id)uiView{
UIView *view = (UIView *)uiView;
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"请回答" delegate:self cancelButtonTitle:@"否" destructiveButtonTitle:@"是" otherButtonTitles:nil, nil];
actionSheet.delegate = self;
[actionSheet showInView:view];
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonInde{
if (buttonInde == 0) {
NSLog(@"确定,");
}else if(buttonInde == 1){
NSLog(@"取消");
}else{
NSLog(@"这是什么");// destructive 这个按钮时最后的
}
}
@end
UIActionSheet
最新推荐文章于 2020-12-23 14:19:30 发布