UIActionSheet 修改字体颜色

-(void)willPresentActionSheet:(UIActionSheet *)actionSheet

{

    SEL selector = NSSelectorFromString(@"_alertController");

    if ([actionSheet respondsToSelector:selector])//ios8

    {

        UIAlertController *alertController = [actionSheet valueForKey:@"_alertController"];

        if ([alertController isKindOfClass:[UIAlertController class]])

        {

            alertController.view.tintColor = [UIColor grayColor];

        }

    }

    else//ios7

    {

        for( UIView * subView in actionSheet.subviews )

        {

            if( [subView isKindOfClass:[UIButton class]] )

            {

                UIButton * btn = (UIButton*)subView;

                

                [btn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];

            }

        }

    }

}

你可能感兴趣的:(action)