Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift3 Swift 3中的UIPageViewController_Swift3_Uipageviewcontroller - Fatal编程技术网

Swift3 Swift 3中的UIPageViewController

Swift3 Swift 3中的UIPageViewController,swift3,uipageviewcontroller,Swift3,Uipageviewcontroller,在PageViewController中,我想添加页面指示器。当我应用两种方法时,使用UIPageVieController数据源方法: func presentationCount(for pageViewController: UIPageViewController) -> Int func presentationIndex(for pageViewController: UIPageViewController) -> Int pageIndicator显示在Vie

PageViewController
中,我想添加页面指示器。当我应用两种方法时,使用
UIPageVieController数据源方法

func presentationCount(for pageViewController: UIPageViewController) -> Int 

func presentationIndex(for pageViewController: UIPageViewController) -> Int 
pageIndicator
显示在
ViewController
的底部,但具有默认的黑色背景颜色、灰色色调和白色当前索引颜色。另外,如果我想确定此
页面的位置,则指示灯
是固定的。它不会改变

以下是屏幕截图:

黑色页面指示器是静态的

但有一个默认的黑色背景色,灰色色调和白色当前索引颜色

使用外观代理更改颜色。例如:

    let proxy = UIPageControl.appearance()
    proxy.pageIndicatorTintColor = UIColor.red.withAlphaComponent(0.6)
    proxy.currentPageIndicatorTintColor = .red
    proxy.backgroundColor = .yellow
另外,如果我想知道这个页面的位置,指示器是固定的。它不会改变

对此你无能为力。如果使用内置页面指示器,则它是内置的。它就在那里。当然,您可以提供自己的UIPageControl并将其放置在您想要的位置,但随后与页面视图控制器的协调将完全取决于您