ios - Style UIPageControl when using AlzheimerPageViewController -
there's documented bug in ios uipageviewcontroller transitionstyle: .scroll not track index due internal caching (on swipe, it'll skip index == 1). person kindly solved problem following gist: https://gist.github.com/paul-delange/5582394.
question: how style uipagecontrol when using alzheimerpageviewcontroller rather uipageviewcontroller? following (swift) code works normal uipageviewcontroller, if put in appdelegate application/didfinishlaunchingwithoptions function, not apply alzheimerpageviewcontroller. goal style pagecontrol (aka dots) gray, on white background.
let pagecontrol = uipagecontrol.appearance() pagecontrol.pageindicatortintcolor = uicolor(nethex: 0xdddddd) pagecontrol.currentpageindicatortintcolor = uicolor(nethex: 0x666666) pagecontrol.backgroundcolor = uicolor.whitecolor()
this how instantiate alzheimerpageviewcontroller in viewdidload():
var pageviewcontroller = alzheimerpageviewcontroller(transitionstyle: .scroll, navigationorientation: .horizontal, options: nil) var startvc = self.viewcontrolleratindex(0) creditcardcontentview var viewcontrollers = nsarray(object: startvc) // draw , set page view controller self.pageviewcontroller.setviewcontrollers(viewcontrollers as! [uiviewcontroller], direction: .forward, animated: true, completion: nil) self.pageviewcontroller.view.frame = cgrectmake(0, 20, self.view.frame.width, 235) self.pageviewcontroller.datasource = self
to clear, alzheimerpageviewcontroller works great , solves index/caching bug. trying figure out uipagecontrol.
Comments
Post a Comment