ios - Swift iOS App 如何在 UITabBarController 上显示 UIView
问题描述
我有一个带有 3 个 ViewController 的 iOS 应用程序,如果用户未登录,则在我的第一个 ViewController 上显示一个弹出窗口,该弹出窗口用黑色 UIView(不透明度 50%,如 UIAlertController)和 2 个按钮(注册或登录)覆盖所有屏幕)。
问题是,tabBar 总是在我的 UIView 上,我想在 tabBar 上显示...(由于不透明度,我不能仅仅隐藏 tabBar,我仍然想在我的黑色不透明度 50% 下看到 tabBar看法。
我尝试使用图层的 zPosition 但这不起作用。
任何想法 ?
谢谢
解决方案
这将是正确的方法:
/* Add dialog to main window */
guard let appDelegate = UIApplication.shared.delegate else { fatalError() }
guard let window = appDelegate.window else { fatalError() }
window?.addSubview(self)
window?.bringSubview(toFront: self)
window?.addSubview(**Your view**)
window?.endEditing(true)
推荐阅读
- regex - RegExp 匹配所有直到两个连续的特殊字符 (]])
- php - Laravel5.8:此路由不支持 GET 方法。支持的方法:POST。问题
- python - Python to_json 函数未将 DataFrame 转换为日期字段的正确格式的 Json
- java - 如何使用 JAVA 从动态创建的 JSON 中递归获取所有键值对
- c++ - 为什么我无法成功登录?
- java - 在区域设置“en_US”的代码“user.title”下未找到消息
- html - 是否有一个 HTML 标签的内容不能包含 JavaScript?
- ios - UIKit的textColor的iOS13白色问题
- c# - 在 C# 中将 JWT 令牌单一声明属性添加为数组元素
- c# - TPL 数据流反馈回路