1、demo包含简单的类文件:
2、使用方法和iOS原生的UIActionSheet基本一样:
- (
IBAction)showActionSheet:(
id)sender {
TLDActionSheet *sheetView = [[TLDActionSheet alloc] initWithTitle:@
"标题" delegate:
self cancelButtonTitle:@
"取消" destructiveButtonTitle:@
"注意!" otherButtonTitles:@[@
"投诉",@
"保存图片",@
"发送给朋友"]];
[sheetView setTitleColor:[
UIColor redColor] WithIndex:
0];
[sheetView setTitleColor:[
UIColor greenColor] WithIndex:
2];
[sheetView setCancelTitleColor:[
UIColor yellowColor]];
[sheetView show];
}
#pragma mark TLDActionSheetDelegate
-(
void)actionSheet:(TLDActionSheet *)actionSheet clickedButtonAtIndex:(
NSInteger)buttonIndex{
NSLog(@
"buttonIndex:%ld",buttonIndex);
}
demo下载地址:http://download.csdn.net/detail/iot_li/9603974
转载请注明原文地址: https://ju.6miu.com/read-1305930.html