Coder Social home page Coder Social logo

Comments (3)

wangmchn avatar wangmchn commented on June 28, 2024

hi, @xoxhk
是否在视图内部使用了Autolayout呢?
最近刚修复了这个引起的bug。
可以使用下最新的,看下bug是否还存在?

from wmpagecontroller.

xoxhk avatar xoxhk commented on June 28, 2024

嗯,非常谢谢你提供的代码,我的每个的controller是从storybord加载的,内部有用autolayout,
我看到你修复的代码了,现在可以了,如果你有空能解释一下为什么就好了,
一直对autolayout的处理过程,导致相关回调函数被调用的情况不实很清楚
CGFloat oldSuperviewHeight = _superviewHeight;
_superviewHeight = self.view.frame.size.height;
if (_hasInited && _superviewHeight == oldSuperviewHeight) return;

from wmpagecontroller.

wangmchn avatar wangmchn commented on June 28, 2024

这段代码主要是判断了 如果 self.view 的高度不变,就禁止下面的代码执行。
(下面代码有对scrollView的contentOffset进行改变)
由于autolayout的存在,在scrollView滚动时会调用 -viewDidLayoutSubviews(具体系统是如何调用的还有待研究,如果知道还望告知),此时会引起重设contentOffset的情况,导致无法滚动或是滚动异常。

from wmpagecontroller.

Related Issues (20)

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.