How to hide the “back” button in UINavigationController?

前端 未结 14 2377
盖世英雄少女心
盖世英雄少女心 2020-12-04 07:09

Do you know how to hide the \'back\' button in a UINavigationController? Also, how to show it back, but I guess that\'s very similar to hiding it...

Just like the ma

14条回答
  •  情深已故
    2020-12-04 08:10

    Swift iOS (I have used following)

    // hide back button
            self.navigationItem.setHidesBackButton(true, animated: false)
    
    // pgrm mark ----- ------
    
        // hide the back button for this view controller
    
        override func setEditing(editing: Bool, animated: Bool) {
            super.setEditing(editing, animated: animated)
    
            self.navigationItem.setHidesBackButton(editing, animated: animated)
    
        }// end setEditing
    

提交回复
热议问题