美文网首页
TableView上滑或者下滑实现头视图或者尾视图方法缩小

TableView上滑或者下滑实现头视图或者尾视图方法缩小

作者: liyuanyunfei | 来源:发表于2016-05-18 16:11 被阅读0次

1、 将需要的imageView实现下面的两个属性


- objcself.footImageView.contentMode = UIViewContentModeScaleToFill; 
 self.footImageView.clipsToBounds = YES_initalFrame = 
_footImageView.frame_defaultViewHight = _initalFrame.size.height;
- (void)scrollViewDidScroll:(UIScrollView*)scrollView { scrollView.backgroundColor = 
[self replaceStringToUIColor:self.carouselModel.bgcolor];
// 滑动的总区域 CGFloat ht = scrollView.contentSize.height - self.tableView.frame.size.height;
 if (scrollView.contentOffset.y >= ht) { CGFloat offsetY = scrollView.contentOffset.y - ht; 
_initalFrame.origin.y = screenHeight - 200 + 50 + 15 + offsetY/1.5;
 // footView在背景视图的高度 _initalFrame.origin.x = -offsetY / 2; 
_initalFrame.size.width = screenWidth + offsetY; 
_initalFrame.size.height = 200 + offsetY / 1.5; _footImageView.frame = _initalFrame; }}

相关文章

网友评论

      本文标题:TableView上滑或者下滑实现头视图或者尾视图方法缩小

      本文链接:https://www.haomeiwen.com/subject/ouewrttx.html