Giter Club home page Giter Club logo

Comments (8)

mooseDev avatar mooseDev commented on September 28, 2024

Quick workaround:

ScrollMenu.swift

` override public func layoutSubviews() {
super.layoutSubviews()

    layoutContent()
    let contentOffsetX = bounds.width * CGFloat(currentPage)
    setContentOffset(CGPoint(x: contentOffsetX, y: contentOffset.y), animated: false)
}`

We need to store 'currentPage' - maybe good idea to make it public.

@serejahh: Feedback? :)

from colormatchtabs.

mooseDev avatar mooseDev commented on September 28, 2024

@serejahh: Oh didn't see your fix. Thought you just closed the issue.

Your latest fix caused wrong index after rotation.

  1. Portrait - Index 2 selected
  2. Rotate
  3. Landscape - Index 2 still selected
  4. Rotate
  5. Portrait - Index 3 selected !!!

Haven't seen the issue with my workaround though... Going to test a lil bit more

from colormatchtabs.

serejahh avatar serejahh commented on September 28, 2024

Please check if your fix works better. Then I'll merge it

from colormatchtabs.

serejahh avatar serejahh commented on September 28, 2024

It seems it works, but when you tap on a tabbar item, a page doesn't change and you can't swipe

from colormatchtabs.

mooseDev avatar mooseDev commented on September 28, 2024

yes you are correct - swipe is broken with my workaround but correct index is shown :(

from colormatchtabs.

mooseDev avatar mooseDev commented on September 28, 2024
public var indexOfVisibleItem: Int {
    if bounds.width > 0 {
        return Int(round(contentOffset.x / bounds.width))
    }
    return 0
}

is returning wrong index after 2nd orientation change. So 'previousIndex' will be messed up.

Maybe related to "Out Of Range" bug ?

from colormatchtabs.

serejahh avatar serejahh commented on September 28, 2024

Seems to be true. When a device is just been rotated from landscape to portrait, bounds is for portrait, but contentSize and contentOffset are for landscape

from colormatchtabs.

sadanand-lowanshi avatar sadanand-lowanshi commented on September 28, 2024

Still getting issue in landscape mode

from colormatchtabs.

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.