iOS: Is there a way to make a viewcontroller look inactive by having everything grayed out?
问题 I want my ViewController and every object appear inactive by having it all grayed out (kind of like how the UIAlertView popup grays out everything in the background). I do not want to have to manually gray out every object there is.Is there an easy way to make this work? 回答1: UIView *grayView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; grayView.backgroundColor = [UIColor colorWithWhite:0.5 alpha:0.5]; [self.view addSubview:grayView]; You can mess with the white and alpha