显示半透明登陆界面如何保留原有的背景视图

我需要显示一个半透明的modal的登录窗口,但是iOS似乎把调用该方法的controller的view隐藏了
因为我有个侧边栏菜单,它本来是被放置于被隐藏的controller的view的后面,当该view被隐藏后,背景变成了侧边栏菜单,但我想要的背景是被隐藏的controller的view
有什么好的办法?我看这里介绍了不少方法,但都不是很方便
http://stackoverflow.com/questions/84...

阅读 8.9k
2 个回答
self.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentModalViewController:modalVC animated:YES]; // 或者你不用动画,自己用UIAnimation做一个alpha的渐隐渐现

尝试一下这个
1、设置你的window的rootViewController

[rootViewController setModalPresentationStyle:UIModalPresentationCurrentContext];

2、用你的rootviewcontroller来present modelview

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题