ios - 将 Xib 中的视图添加到透明视图中,为什么它显示得更暗?
问题描述
这是代码
self.viewD = DayViewCalendar(frame: CGRect(x: 0, y: 0, width:
self.containerView.frame.size.width, height:
self.containerView.frame.size.height))
这是不透明的,是错误的,背景是清晰的。
self.viewD.isOpaque = false
self.viewD.backgroundColor = UIColor.clear
self.containerView.addSubview(self.viewD)
也适用于容器
container.isOpaque = false
container.backgroundColor = UIColor.clear
输出 :
如果我不添加 ViewD,则容器是透明的,如图所示
问题
为什么 Tow Transparent UIViews 不透明,它显示得稍暗
请建议我在哪里做错了
解决方案
从长远来看,这里有一些可以帮助你的东西。
这可以帮助您调试视图组件并告诉您究竟是哪个视图导致了 UI 中的灰色区域。
希望这可以帮助。快乐调试
推荐阅读
- python - 使用 cython 时出现 GCC 问题
- python - Django 迁移 - django.db.migrations.exceptions.NodeNotFoundError
- jsf - JSF 无法将数据传递给 bootsrtap 模式
- automated-tests - 使用 webdriverio 的 waitUntil() 让 webdriverio 等待一个元素?
- javascript - 来自不同项目/域的 webpack 和 vue 异步组件
- java - Java bufferstrategy,图形错误::尚未创建缓冲区
- jboss - Standalone.xml 中的 Jboss 7.1 日志过滤器
- python - 在 int python 中转换 SQLITE 'NoneType
- java - SiddhiQL 中的语法错误,输入时没有可行的替代方案
- ios - Codenameone - IOS 调试构建失败