您的位置:首页 > 产品设计 > UI/UE

UIActionSheet

2015-06-21 16:27 405 查看
//
//  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