iphone - Navigate to specific page in scrollView with paging, programmatically -


how navigate specific page programmatically. have app scrollview populated bunch of subviews (tableviews in case). when clicking on subview zooms in , user can edit , navigate table, when zoom out reload entire view in case there changed made user. of course reloading view sends user page 0. i've tried setting pagecontrol.currentpage property change dot of pagecontrol. mean wrong or need else well??

all controlling page scrolling method:

- (void)scrollviewdidscroll:(uiscrollview *)sender  { cgfloat pagewidth = self.scrollview.frame.size.width; int page = floor((self.scrollview.contentoffset.x - pagewidth / 2) / pagewidth) + 1; self.pagecontrol.currentpage = page;  nsstring *listname = [self.wishlists objectatindex:self.pagecontrol.currentpage]; self.labellistname.text = listname; } 

you have calculate corresponding scroll position manually. scroll page i:

[scrollview setcontentoffset:cgpointmake(scrollview.frame.size.width*i, 0.0f) animated:yes]; 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -