Comments (5)
半塘的也是这样的。切换之后到下一个的第一行。当然这个可以自己设置。
from jsdbantanghomedemo.
不想要切换之后立马调到第一行,怎么自己设置?
from jsdbantanghomedemo.
你需要记录下每一个tableView的偏移量,然后切换的时候设置就好了。
from jsdbantanghomedemo.
这样会有问题吧,比如说A界面的tableView的offset是200,据此计算应该将headerView推上去到看不见 。然后切换到B,此时滑动B的tableView,offset为100,那么此时headerView会有一部分露出来。如果此时再切换回A,设置之前记录的offset为200的话,会触发KVO,此时headerView会瞬间从"有一部分露出来"变为“看不见”。这个应该是有问题的吧
from jsdbantanghomedemo.
我现在是在达到临界值之后。如果你点击就到切换,就会设置tableView偏移量相应的值。
self.currentTableView = self.tableViews[index];
for (UITableView *tableView in self.tableViews) {
if ( self.lastTableViewOffsetY>=0 && self.lastTableViewOffsetY<=136) {
tableView.contentOffset = CGPointMake(0, self.lastTableViewOffsetY);
}else if(self.lastTableViewOffsetY < 0){
tableView.contentOffset = CGPointMake(0, 0);
}else if ( self.lastTableViewOffsetY > 136){
tableView.contentOffset = CGPointMake(0, 136);
}
}
这个值你要是能记录下来,也是可以自己设置的,我是设置为初始值而已。触发KVO也是根据坐标值来判断要不要隐藏header相关组件的,所以你可以试一试。
from jsdbantanghomedemo.
Related Issues (6)
- 撸主,添加cell的点击事件后,用window.rootViewController跳页面奔溃 HOT 2
- 当从一个控制器滑到另一个控制器,再返回来。控制器又滑到顶点了 HOT 2
- 创建导航后,点击cell无法push HOT 8
- 怎样在轮播图位置上下滑动拖动整个界面 HOT 5
- 一次性请求这么多数据,不会卡么? 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 jsdbantanghomedemo.