的頁面大小指示我創建UIPageViewController使用教程從這個blog如何改變UIPageViewController
現在我需要改變頁面指示器框架的大小。 我已經試圖改變一個控制器,但沒有成功
這裏的幀大小的代碼我使用
private func createPageViewController() {
let mainStoryboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
let pageController = mainStoryboard.instantiateViewControllerWithIdentifier("ImagesPagerViewController") as! UIPageViewController
pageController.dataSource = self
if contentImages.count > 0 {
let firstController = getItemController(0)!
let startingViewControllers: NSArray = [firstController]
pageController.setViewControllers(startingViewControllers as? [UIViewController], direction: UIPageViewControllerNavigationDirection.Forward, animated: false, completion: nil)
}
pageViewController = pageController
addChildViewController(pageViewController!)
self.view.addSubview(pageViewController!.view)
pageViewController!.didMoveToParentViewController(self)
}
//Setting appearance globally
private func setupPageControl() {
let appearance = UIPageControl.appearance()
appearance.pageIndicatorTintColor = UIColor.grayColor()
appearance.currentPageIndicatorTintColor = UIColor.whiteColor()
appearance.backgroundColor = UIColor.redColor()
}
是否有解決方案這樣做呢?
你有沒有讓你解決? –
編程方式,我沒有找到解決方案,使用Alessandro Ornano的答案 – korgx9