我正在尝试使用静态位置计数器添加UIPageView。但是UIPageView页面隐藏了Counter Label
以下代码-我在ControllerView中创建PageViewController。
func createPageViewController(){
let pageVC = self.storyboard?.instantiateViewController(identifier:
Constant.storyIdPageViewIdentifier) as! UIPageViewController
pageVC.dataSource = self
if carsArray.count>0 {
let imageController = getImageViewController(withIndex: 0)!
let imageControllers = [imageController]
pageVC.setViewControllers(imageControllers, direction: .forward, animated: true, completion: nil)
}
pageViewController = pageVC
self.addChild(pageViewController!)
self.view.addSubview(pageViewController!.view)
pageViewController?.didMove(toParent: self)
}
答案 0 :(得分:2)
尝试使用 self.view.bringSubviewToFront(counterlabel)