Skip to content

Commit

Permalink
Fix an initial item-size issue of Basic Example in FSPagerViewExample…
Browse files Browse the repository at this point in the history
…-Objc
  • Loading branch information
WenchaoD committed Sep 12, 2018
1 parent 6085e24 commit b96ab55
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ - (void)viewDidLoad
self.numberOfItems = 7;

[self.pagerView registerClass:[FSPagerViewCell class] forCellWithReuseIdentifier:@"cell"];
self.pagerView.itemSize = self.pagerView.frame.size;
self.pagerView.itemSize = CGSizeZero;
self.pageControl.numberOfPages = self.imageNames.count;
self.pageControl.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
self.pageControl.contentInsets = UIEdgeInsetsMake(0, 20, 0, 20);
Expand Down Expand Up @@ -90,7 +90,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
slider.tag = indexPath.section;
slider.value = ({
CGFloat scale = self.pagerView.itemSize.width/self.pagerView.frame.size.width;
CGFloat value = (scale-0.5)*2;
CGFloat value = (0.5-scale)*2;
value;
});
slider.continuous = YES;
Expand Down

0 comments on commit b96ab55

Please sign in to comment.