用tableview解决长文字,过多项的ActionSheet
查看次数:3938
下载次数:422
上传时间:2015-06-09
大小:139 B
测试环境:Xcode 6.2,iOS 6.0以上
- (id) initWithTitle:(NSString *)title delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ... {
if (self = [super initWithFrame:[UIScreen mainScreen].bounds]) {
_title = title;
_delegate = delegate;
_cancelButtonTitle = cancelButtonTitle;
_otherButtonArray = [NSMutableArray array];
va_list args;
va_start(args, otherButtonTitles);
if (otherButtonTitles) {
[_otherButtonArray addObject:otherButtonTitles];
while (1) {
NSString *otherButtonTitle = va_arg(args, NSString *);
if (otherButtonTitle == nil) {
break;
} else {
[_otherButtonArray addObject:otherButtonTitle];
}
}
}
va_end(args);
self.backgroundColor = [UIColor clearColor];
UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)];
_backgroundView = [[UIView alloc] initWithFrame:self.frame];
_backgroundView.alpha = 0;
_backgroundView.backgroundColor = [UIColor blackColor];
[_backgroundView addGestureRecognizer:tapGestureRecognizer];
[self addSubview:_backgroundView];
[self initContentView];
}
return self;
}
收藏