Giter Site home page Giter Site logo

头部高度变化如何更新 about aquaman HOT 5 CLOSED

bawn avatar bawn commented on August 25, 2024
头部高度变化如何更新

from aquaman.

Comments (5)

bawn avatar bawn commented on August 25, 2024

简单一点在 AquamanPageViewController.swift 中添加一个方法

 public func updateHeaderView() {
        headerViewHeight = headerViewHeightFor(self)
        headerViewConstraint?.constant = headerViewHeight
    }

然后

override func pageController(_ pageController: AquamanPageViewController, mainScrollViewDidScroll scrollView: UIScrollView) {
        print(scrollView.contentOffset)
        headerViewHeight -= scrollView.contentOffset.y
        updateHeaderView()
    }

不过你需要考虑的是 scrollView.contentOffset 同时也在变化

from aquaman.

LucioLee avatar LucioLee commented on August 25, 2024

多谢!已经解决,只是希望从库的层面提供支持,不想改库
image

from aquaman.

LucioLee avatar LucioLee commented on August 25, 2024

还有一个问题,menuViewPinHeight这个参数我理解上应该是对menuView吸附效果做一个附加偏移,我看Demo中这个值传了一个导航栏的高度,能不能在库里实现对safeArea的适配?

from aquaman.

bawn avatar bawn commented on August 25, 2024

谢谢你的意见,后续我会考虑优化

from aquaman.

bawn avatar bawn commented on August 25, 2024

@LucioLee

还有一个问题,menuViewPinHeight这个参数我理解上应该是对menuView吸附效果做一个附加偏移,我看Demo中这个值传了一个导航栏的高度,能不能在库里实现对safeArea的适配?

已经实现

from aquaman.

Related Issues (8)

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.