怎么弹出一个半透明的UIViewController?

以下方法不行
UIViewController* controller = self.view.window.rootViewController;

怪盗饭团
浏览 3241回答 2
2回答

kscorpio

半透明的  UIViewController  全屏的还是 还是仅仅是一个小菜单如果是全屏的 直接present 然后把backgroundColor  设为clear就行如果是 小菜单或者popview 就不用viewcontroler了  就只 addsubview 一个透明view

SeanJackson

UIViewController *vc = [SecondViewController init];    vc.view.backgroundColor = [UIColor clearColor];   vc.modalPresentationStyle = UIModalPresentationCurrentContext;/*设置这个属性背景就是透明的,而不是黑色的了*/    [self presentModalViewController:vc animated:NO];
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

iOS