【发布时间】:2016-07-29 10:10:42
【问题描述】:
我在我的代码中使用this 示例。它现在工作得很好,但是当我点击一个按钮时它没有响应或调用任何方法。这是我的代码:
UICustomActionSheet* customActionSheet = [[UICustomActionSheet alloc] initWithTitle:nil delegate:nil buttonTitles:@[@"Cancel",@"Delete picture", @"Take a new photo", @"Choose from existing"]];
[customActionSheet setButtonColors:@[[UIColor redColor]]];
[customActionSheet setBackgroundColor:[UIColor clearColor]];
[customActionSheet setSubtitle:@"Select your Choice"];
[customActionSheet setSubtitleColor:[UIColor whiteColor]];
[customActionSheet showInView:self.view];
这是需要调用的方法
-(void)customActionSheet:(UICustomActionSheet *)customActionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
NSLog(@"%d",buttonIndex);
}
【问题讨论】:
标签: ios xcode uiactionsheet uiactionsheetdelegate