当我向UIPageViewController添加UIPageControl时,UIPageViewController的约束底部无效,UIPagecontrol
被推入安全区域。
图像: 和
如何在屏幕底部制作UIPageControl重叠主页指示符。
Apple Human Interface Guidelines
我要添加UIPageControl
private func setupPageControl() {
let appearance = UIPageControl.appearance()
appearance.pageIndicatorTintColor = UIColor.gray
appearance.currentPageIndicatorTintColor = UIColor.white
appearance.backgroundColor = #colorLiteral(red: 0.3034487963, green: 0.2256524563, blue: 0.2956835628, alpha: 1)
}
func presentationCount(for pageViewController: UIPageViewController) -> Int {
setupPageControl()
return self.orderViewController.count
}
func presentationIndex(for pageViewController: UIPageViewController) -> Int {
return 0
}
答案 0 :(得分:0)
看起来好像已经设置了自动布局约束,所以您的底部对齐方式是在安全区域而不是超级视图。如果要使其重叠,则可以将其与超级视图对齐,例如