隐藏子视图会在视图上留下微弱的阴影

问题描述 投票:1回答:2

我有一个垂直堆栈视图,其中包含两个视图。我已将第二个视图的背景颜色与主视图背景的背景颜色相匹配,这样当我将其隐藏时,我希望它与主背景相匹配。但是,我得到的是屏幕上可见的微弱区域(显示的图像)。有没有办法删除它? When the view is visible When the view is hidden

ios swift view background-color hidden
2个回答
1
投票

更改堆栈视图和第二个视图的背景颜色以使其透明

enter image description here


0
投票

第二个视图的背景颜色无关紧要,因为您将视图设置为隐藏。

你在这里看到的是UIStackView的背景颜色,所以将UIStackView的背景颜色设置为clearColor

© www.soinside.com 2019 - 2024. All rights reserved.