Fork me on GitHub

presentModalViewController显示半透明的一个view

UIViewController* transparentView = [[UIViewController alloc] init];

UIViewController* controller = self.view.window.rootViewController;

transparentView.view.backgroundColor = [UIColor blackColor];

transparentView.view.alpha = 0.5f;

controller.modalPresentationStyle = UIModalPresentationCurrentContext;

[controller presentModalViewController:transparentView animated:YES];

其要点就是使用iOS特有的rootViewController来显示Modal View

posted on 2012-02-16 22:15  pengyingh  阅读(1160)  评论(0编辑  收藏  举报

导航