为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

iOS
怪盗饭团 2016-05-13 18:55:07
以下方法不行UIViewController* controller = self.view.window.rootViewController;
查看完整描述

2 回答

?
kscorpio

TA贡献20条经验 获得超13个赞

半透明的  UIViewController  全屏的还是 还是仅仅是一个小菜单

如果是全屏的 直接present 然后把backgroundColor  设为clear就行

如果是 小菜单或者popview 就不用viewcontroler了  就只 addsubview 一个透明view

查看完整回答
1 反对 回复 2016-05-17
?
SeanJackson

TA贡献1条经验 获得超1个赞

UIViewController *vc = [SecondViewController init];
   vc.view.backgroundColor = [UIColor clearColor];

  vc.modalPresentationStyle = UIModalPresentationCurrentContext;/*设置这个属性背景就是透明的,而不是黑色的了*/

   [self presentModalViewController:vc animated:NO];

查看完整回答
1 反对 回复 2016-05-14
  • 2 回答
  • 0 关注
  • 3230 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信