ISColumnsController icon indicating copy to clipboard operation
ISColumnsController copied to clipboard

How to animate the paging on external events

Open Quamber opened this issue 10 years ago • 2 comments

1st of all. Its a great repository indeed however I am going to add some tabs in the main window and i want to shift pages from those tabs how can i do that.?

Quamber avatar Apr 11 '14 12:04 Quamber

This library does not have the interface to set current page programmatically, but you can set scrollView.contentOffset and pageControl.currentPage by following code.

NSInteger page = 1;
CGPoint contentOffset = CGPointMake(self.scrollView.frame.size.width * page, 0.f);
[self.scrollView setContentOffset:contentOffset animated:YES];
[self.pageControl setCurrentPage:page];

If you placed columns controller in UINavigationController, columnsController.edgesForExtendedLayout should be UIRectEdgeNone.

ishkawa avatar Apr 13 '14 11:04 ishkawa

Great work. Working perfectly Add method like this in controller

  -(void)moveToPage:(NSInteger)page
 {
      if (page <= [self.viewControllers count]-1) 
      {
          CGPoint contentOffset = CGPointMake(self.scrollView.frame.size.width * page, 0.f);
          [self.scrollView setContentOffset:contentOffset animated:YES];
          [self.pageControl setCurrentPage:page];
     }
 }

paresh-navadiya avatar Jan 23 '15 13:01 paresh-navadiya