ios - UIPageViewController page control background color -
i'm using uipageviewcontroller in app , it's working fine. however, it's page control has been added automatically has black background hiding current view controller's bottom material (see picture below). possible call uipageviewcontroller's page control , change it's color? want page control shown on view controller (example, path app's walkthrough) setting color instead of black clear.
you can use appearance
change color of uipagecontrol otherwise not accessible. try doing in appdelegate's didfinishlaunchingwithoptions
function given below.
- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { uipagecontrol *pagecontrol = [uipagecontrol appearance]; pagecontrol.pageindicatortintcolor = [uicolor lightgraycolor]; pagecontrol.currentpageindicatortintcolor = [uicolor blackcolor]; pagecontrol.backgroundcolor = [uicolor bluecolor]; return yes; }
to apply style particular view controller, can use appearancewhencontainedin
instead following:
uipagecontrol *pagecontrol = [uipagecontrol appearancewhencontainedin:[myviewcontroller class], nil];
only uipagecontrol
objects contained in myviewcontroller
going style.
edit: black background around uipagecontrol
@ bottom of screen due background color of uipageviewcontroller
not uipagecontrol
. can change color following:
- (void)viewdidload { [super viewdidload]; self.view.backgroundcolor = [uicolor bluecolor]; //set whatever }
Comments
Post a Comment