iphone - problem in UIPageControl -
pagecontrol = [[uipagecontrol alloc] initwithframe:cgrectmake(153,356,38,36) ]; pagecontrol.userinteractionenabled =yes; pagecontrol.numberofpages = 2; pagecontrol.currentpage = 1; pagecontrol.enabled = true; [pagecontrol sethighlighted:yes]; [pagecontrol addtarget:self action:@selector(changepage:) forcontrolevents:uicontroleventvaluechanged]; [self.view addsubview:pagecontrol]; } - (ibaction) changepage:(id)sender { }
i'm programmatically creating page control , want display new view controllers on click of page control. how need implement changepage method? can help?
you can show 2 views instead of showing 2 different view controller. can keep first dot selected , show first view , have next view out of screen, right. when user taps second dot, make uiview animation similar pushing in uinavigationcontroller. thus, push , pop uiview animation.
if want show view controllers, page control needs shown in both view controller, user can switch 1 another. in such case, need have page control in view, added in main window, visible everywhere.
Comments
Post a Comment