Im working on a scrollview and I want it to be with paging enabled, but when I try to set a custom width to the content I cant, I need someones help, Thanks!
Heres what Im trying:
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset {
int PageNum = (int)(scrollView.contentOffset.x / 140);
targetContentOffset->x = PageNum * (int)(targetContentOffset->x / PageNum);
}
When scrollViewDidScroll:
I add a NSlog and Its printing correctly the current page, what does not work is the custom for the paging width:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
int PageNum = (int)(scrollView.contentOffset.x / 140);
NSLog(@"%d", PageNum);
}
Hope someone can Help me, thanks!