- (void)willPresentActionSheet:(UIActionSheet *)actionSheet // before animation and showing view
{
// 搜尋UIActionSheet中的Action Sheet Button View
for (UIView* view in [actionSheet subviews])
{
if ([[[view class] description] isEqualToString:@"UIThreePartButton"])
{
if ([view respondsToSelector:@selector(title)])
{
// 修改位置
NSString* title = [view performSelector:@selector(title)];
if ([title isEqualToString:@"Button 1"] && [view respondsToSelector:@selector(setEnabled:)])
{
[view performSelector:@selector(setEnabled:) withObject:NO];
}
}
}
}
}
沒有留言:
張貼留言