Git Product home page Git Product logo

Comments (5)

JoySeeDog avatar JoySeeDog commented on July 4, 2024

半塘的也是这样的。切换之后到下一个的第一行。当然这个可以自己设置。

from jsdbantanghomedemo.

tujinqiu avatar tujinqiu commented on July 4, 2024

不想要切换之后立马调到第一行,怎么自己设置?

from jsdbantanghomedemo.

JoySeeDog avatar JoySeeDog commented on July 4, 2024

你需要记录下每一个tableView的偏移量,然后切换的时候设置就好了。

from jsdbantanghomedemo.

tujinqiu avatar tujinqiu commented on July 4, 2024

这样会有问题吧,比如说A界面的tableView的offset是200,据此计算应该将headerView推上去到看不见 。然后切换到B,此时滑动B的tableView,offset为100,那么此时headerView会有一部分露出来。如果此时再切换回A,设置之前记录的offset为200的话,会触发KVO,此时headerView会瞬间从"有一部分露出来"变为“看不见”。这个应该是有问题的吧

from jsdbantanghomedemo.

JoySeeDog avatar JoySeeDog commented on July 4, 2024

我现在是在达到临界值之后。如果你点击就到切换,就会设置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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.