Git Product home page Git Product logo

Comments (4)

lixiang1994 avatar lixiang1994 commented on August 15, 2024

感觉可以用func setViewControllers(_ viewControllers: [UIViewController], animated: Bool)交换实现 来更新backBarButtonItem的显示, 明天我改一下试试看.

from eachnavigationbar.

lixiang1994 avatar lixiang1994 commented on August 15, 2024

EachNavigationBarbackBarButtonItem 使用的是leftBarButtonItem, 这是否会和外部设置的leftBarButtonItemleftBarButtonItems 发生冲突??

这个问题很矛盾 我感觉需要你来斟酌一下, 是否要尽量与原生NavigationBar的特性保持一致?

    /// Bar button item to use for the back button in the child navigation item.
    open var backBarButtonItem: BackBarButtonItem? {
        didSet {
            backBarButtonItem?.navigationController = viewController?.navigationController
            
            viewController?._navigationItem.leftBarButtonItem = backBarButtonItem
        }
    }

from eachnavigationbar.

Pircate avatar Pircate commented on August 15, 2024

EachNavigationBarbackBarButtonItem 使用的是leftBarButtonItem, 这是否会和外部设置的leftBarButtonItemleftBarButtonItems 发生冲突??

这个问题很矛盾 我感觉需要你来斟酌一下, 是否要尽量与原生NavigationBar的特性保持一致?

    /// Bar button item to use for the back button in the child navigation item.
    open var backBarButtonItem: BackBarButtonItem? {
        didSet {
            backBarButtonItem?.navigationController = viewController?.navigationController
            
            viewController?._navigationItem.leftBarButtonItem = backBarButtonItem
        }
    }

系统的 backBarButtonItem 无法通过 UINavigationBar 来控制,所以只能自己实现了这套逻辑

from eachnavigationbar.

lixiang1994 avatar lixiang1994 commented on August 15, 2024

setViewControllers的场景你看看怎么处理比较好?

from eachnavigationbar.

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.