Hide TabBar and Show UIToolbar

1

In my project I have a TableView inside navigation controller

(TabBar > Navigation Controller > TableView Controller)

When I click the Edit button the TabBar is being hidden and displaying the Toolbar, but it is not adjusting in the footer.

How can I adjust this?

I'm using Storyboard and Swift.

    
asked by anonymous 09.08.2016 / 21:25

1 answer

1

To give hidden in TabBar

Add this line in Swift's ViewDidLoad ():

self.tabBarController?.tabBar.hidden = true

To show UiToolBar And in ViewDidLoad () try it here too

toolBar.barStyle = UIBarStyle.Black
       self.view.addSubview(toolBar)

Example:

import UIKit

class ViewController: UIViewController {

var toolBar = UIToolbar(frame:CGRectMake(0, 524, 320, 44))

    override func viewDidLoad() {
        super.viewDidLoad()

        self.tabBarController?.tabBar.hidden = true

        toolBar.barStyle = UIBarStyle.Black
       self.view.addSubview(toolBar)

    }
}
    
25.08.2016 / 15:34