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

kscorpio
TA貢獻20條經驗 獲得超13個贊
半透明的 ?UIViewController ?全屏的還是 還是僅僅是一個小菜單
如果是全屏的 直接present 然后把backgroundColor ?設為clear就行
如果是 小菜單或者popview 就不用viewcontroler了 ?就只 addsubview 一個透明view

SeanJackson
TA貢獻1條經驗 獲得超1個贊
UIViewController *vc = [SecondViewController init];
? ?vc.view.backgroundColor = [UIColor clearColor];
? vc.modalPresentationStyle = UIModalPresentationCurrentContext;/*設置這個屬性背景就是透明的,而不是黑色的了*/
? ?[self presentModalViewController:vc animated:NO];
- 2 回答
- 0 關注
- 3389 瀏覽
添加回答
舉報
0/150
提交
取消