Code Monkey home page Code Monkey logo

Comments (7)

aslanyanhaik avatar aslanyanhaik commented on June 1, 2024

@roshanman sorry for late response. Yes, look for "hideBar" method which is hiding the navigation bar on swipe

from youtube-ios.

roshanman avatar roshanman commented on June 1, 2024

Thanks, I have noticed the method hideBar

func hideBar(notification: NSNotification)  {
        let state = notification.object as! Bool
        self.navigationController?.setNavigationBarHidden(state, animated: true)
}

In this method, we just hide the navigationbar, I don't understand why when we hide the navigationbar, the tabbar go to the top position automatic.

Thank you.

from youtube-ios.

aslanyanhaik avatar aslanyanhaik commented on June 1, 2024

it's done automatically by iOS. Once you hide the navbar, everything inside the main view goes up with animation.

from youtube-ios.

roshanman avatar roshanman commented on June 1, 2024

record

Why my button do not moved when i hide the navbar ?

from youtube-ios.

aslanyanhaik avatar aslanyanhaik commented on June 1, 2024

Hey @roshanman that's a good question. It depends how you build UI. If your constrains linked with NavBar then it will animate up, otherwise it will not move. Check the attachment.
navBar.zip

from youtube-ios.

roshanman avatar roshanman commented on June 1, 2024

Thanks for your help. This method worked.

But in your code

lazy var tabBar: TabBar = {
    let tb = TabBar.init(frame: CGRect.init(x: 0, y: 0, width: globalVariables.width, height: 64))
    tb.delegate = self
    return tb
}()

//TabBar
self.view.addSubview(self.tabBar)

you do have not used constrains for tabbar. really strange!

from youtube-ios.

aslanyanhaik avatar aslanyanhaik commented on June 1, 2024

@roshanman yeah, it was a bad decision. In upcoming update will replace InitWithFrames with constrains

from youtube-ios.

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.