英文:
Opacity only works for a moment when modally presenting a UIPageViewController
问题
我有一个模态跳转到UIPageViewController。
我想让UIPageViewController的背景变得透明。我已经在viewDidLoad()中设置了这个,并且已经为页面视图控制器设置了自定义视图控制器,其背景为深灰色,不透明度为0.98。
当跳转出现时,0.98的不透明度大约持续了一秒钟,然后变得不透明。
我尝试过全屏和当前上下文的呈现样式,还尝试过将自定义视图控制器的背景设置为.clear / 页面视图控制器中的不透明度0.98。
有什么想法吗?
英文:
I have a modal segue to a UIPageViewController.
I would like the background of the UIPageViewController to be clear. I have set this in the viewDidLoad(), and have set the custom view controller for the page view controller to have a dark grey background with 0.98 opacity.
When the segue pops up, the 0.98 opacity works for about a second and then goes opaque.
I've tried both full screen and current context presentation styles, and tried swapping so that it's background = .clear in the custom view controller / opacity 0.98 in the page view controller.
Any ideas?
答案1
得分: 0
- 将segue呈现方式更改为自动
- 在UIPageViewController的viewDidLoad()中,将view.backgroundColor设置为.clear
- 在自定义视图控制器的viewDidLoad()中,设置backgroundColor为.clear和opacity
英文:
- Changed segue presentation to automatic
- view.backgroundColor = .clear in UIPageViewController viewDidLoad()
- backgroundColor = .clear and opacity in the custom View Controller viewDidLoad()
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论