diff --git a/Ifish/views/introductionView/MyIntroductionViewController.m b/Ifish/views/introductionView/MyIntroductionViewController.m index 485ecd1..792145c 100644 --- a/Ifish/views/introductionView/MyIntroductionViewController.m +++ b/Ifish/views/introductionView/MyIntroductionViewController.m @@ -94,21 +94,18 @@ static MyIntroductionViewController * introduction = nil; } -(void)setUpScrollView{ - self.scrollView.contentSize = CGSizeMake(self.scrollView.bounds.size.width*self.imageNames.count, self.scrollView.bounds.size.height); + CGFloat width = CGRectGetWidth([UIScreen mainScreen].bounds); + CGFloat height = CGRectGetHeight([UIScreen mainScreen].bounds); + self.scrollView.contentSize = CGSizeMake(width * self.imageNames.count, height); self.scrollView.bounces=NO; //views for (int i=0; iself.scrollView.frame.size.width) { - frame.size.width = self.scrollView.bounds.size.width; - frame.size.height = frame.size.width * oldH / oldW; - imgV.frame = frame; - } - imgV.center = CGPointMake((i+0.5)*self.scrollView.bounds.size.width, self.scrollView.bounds.size.height/2); + imgV.contentMode = UIViewContentModeScaleAspectFill; + imgV.layer.masksToBounds = YES; + CGFloat x = i * width; + imgV.frame = CGRectMake(x, 0, width, height); [self.scrollView addSubview:imgV]; [self.imageViews addObject:imgV]; }