Swift/iOS8: Why are Page Control indicators not showing?

后端 未结 6 2448
暗喜
暗喜 2021-02-19 08:54

I am implementing a straightforward gallery view controller where the app displays a small range of full-screen images that the user can scroll through. I\'m using UIPageViewCon

6条回答
  •  你的背包
    2021-02-19 09:00

    Even if you will change color of UIPageControl it may not appear. If UIPageController is inside the UITabBarController the TabBar will cover the UIPageControl. The best way to find it is use option Debug->View Debubging->CaptureViewHierarchy. Then in the left bottom filter field type "pageControl". If you click it in the navigator it should locate it on the screen (take a look at the screenshot)

    You can change the position like this:

    let controlHeight: CGFloat = 50
        let bottomSpace: CGFloat = 20
        let yPosition = view.frame.size.height - (controlHeight + bottomSpace)
        let fullScreenWidth = view.frame.size.width
        let frame = CGRect(x: 0, y: yPosition, width: fullScreenWidth, height: controlHeight)
    
        pageControl.frame = frame
    

提交回复
热议问题