Hide Tabbar and Show Uitoolbar

Asked

Viewed 65 times

1

In my project I have a Tableview within navigation controller

(Tabbar > Navigation Controller > Tableview Controller)

When I press the Edit Tabbar button is being hidden and showing the Toolbar, but it is not adjusting in the footer.

How can I adjust it ?

I’m using Storyboard and Swift.

Imagem mostrando TabBar

Imagem mostrando Toolbar

1 answer

1


To give Hidden in Tabbar

Add this line in Swift’s Viewdidload() :

self.tabBarController?.tabBar.hidden = true

To show the Uitoolbar And in Viewdidload() try this 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)

    }
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.