Comments (3)
这个通常需要考虑交互,我研究一下。回头给你回复
from swipetableview.
麻烦了。
from swipetableview.
这个功能已经解决,在点击header的时候,对当前item的offset与inset(或者tableHeaderView的height进行调整),具体代码如下
// tap to change header's frame
- (void)tapHeader:(UITapGestureRecognizer *)tap {
CGFloat changeHeight = 50; // or -50, it will be parallax.
UIScrollView * currentItem = _swipeTableView.currentItemView;
#if !defined(ST_PULLTOREFRESH_HEADER_HEIGHT)
CGPoint contentOffset = currentItem.contentOffset;
UIEdgeInsets inset = currentItem.contentInset;
inset.top += changeHeight;
contentOffset.y -= changeHeight; // if you want the header change height from up, not do this.
NSMutableDictionary * contentOffsetQuene = [self.swipeTableView valueForKey:@"contentOffsetQuene"];
[contentOffsetQuene removeAllObjects];
[UIView animateWithDuration:.35f delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
_tableViewHeader.st_height += changeHeight;
currentItem.contentInset = inset;
currentItem.contentOffset = contentOffset;
} completion:^(BOOL finished) {
[self.swipeTableView setValue:@(self.tableViewHeader.st_height) forKey:@"headerInset"];
}];
#else
UIView * tableHeaderView = ((UITableView *)currentItem).tableHeaderView;
tableHeaderView.st_height += changeHeight;
[UIView animateWithDuration:.35f delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
_tableViewHeader.st_height += changeHeight;
[currentItem setValue:tableHeaderView forKey:@"tableHeaderView"];
} completion:^(BOOL finished) {
[self.swipeTableView setValue:@(self.tableViewHeader.st_height) forKey:@"headerInset"];
}];
#endif
}
示例代码已经提交,并且header中imageview做了调整。可以在demo中替换点击header的tapHeader:
方法,运行查看效果
from swipetableview.
Related Issues (20)
- 给继承自STCollectionView 的collectionview 添加MJRefreshHeader 下拉刷新回弹位置错误 HOT 1
- 使用方法还是太不方便了
- alwaysBounceHorizontal 属性没有效果
- 添加mj_header位置问题 HOT 1
- reoloadData无效
- swipeTableViewWillBeginDragging不响应
- Tableview的点击
- Multiple methods named 'frame' found with mismatched result, parameter type or attributes HOT 2
- MJRefresh上拉加载更多 偏移量问题 HOT 2
- 动态修改headview高度的时候显示不正确
- 没有用autolayout的后果
- iOS12 - iPhoneXS 右滑crash HOT 3
- 从别的页面返回更新headerView的高度时布局不对 HOT 1
- 提两点功能补充
- iPhone X适配 和 sectionHeader问题
- iOS 8 crash
- STHeaderView 手势冲突问题
- 如果进入页面,想指定某一个item展示,而不是默认第一个item0,怎么处理?是不是应该暴露一个selectedIndex HOT 1
- attempt to scroll to invalid index path:
- 在维护App的时候,发现了前人集成了这个东西,代码耦合度高的吓人,还很容易触发异步刷新的crash问题,虽然我做了很多修改,源码也做了修改。controller 代码就有5000行,我是心力交瘁啊 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swipetableview.