Using layout subviews instead of will appear

This commit is contained in:
Kyle Fang
2015-07-07 11:40:53 +08:00
parent 86fc24816b
commit 099450f394

View File

@@ -26,12 +26,12 @@ static CGFloat kImageOriginHight = 240.f;
[self.tableView addSubview:self.expandZoomImageView];
}
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
- (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];
self.expandZoomImageView.frame = CGRectMake(0, -kImageOriginHight, self.tableView.frame.size.width, kImageOriginHight);
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
CGFloat yOffset = scrollView.contentOffset.y;
if (yOffset < -kImageOriginHight) {