- (void)willPresentActionSheet:(UIActionSheet *)actionSheet { if ([[[UIDevice currentDevice] systemVersion] floatValue] > 4.9) { for (UIView *view in actionSheet.subviews) { if (view.tag == 2) { UIButton *button = (UIButton *) view; //改变背景 [button setBackgroundImage:[button backgroundImageForState:UIControlStateHighlighted] forState:UIControlStateNormal]; //改变颜色 [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; //btn的选择状态,否则选择后不变背景 [button setSelected:YES]; } else { } } } else { //IOS4之前版本下按钮不是继承于UIButton而是UIThreePartButton for (UIView *view in actionSheet.subviews) { if (view.tag == 2) { UIControl *btn = (UIControl *) view; [btn setSelected:YES]; } else { } } } }