当我从视图回到标签栏控制器时,标签栏不显示

When i go from view back to tab bar controller, the tab bar doesnt show

我要从标签栏控制器视图转到另一个不属于标签栏控制器的视图。当我尝试通过按后退按钮从视图返回到选项卡栏控制器视图时,选项卡栏不显示。按钮的代码在 back_golf 下。该视图不在导航控制器中

import UIKit
import Firebase

class Golf: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var tableview_golf: UITableView!

var array = [String]()
var ref : DatabaseReference!
var handle: DatabaseHandle!

@IBAction func back_golf(_ sender: Any) {


let appDelegate = UIApplication.shared.delegate as! AppDelegate
let navigationController = appDelegate.window?.rootViewController as! 
UINavigationController

 navigationController.dismiss(animated: true, completion: nil)
  //self.navigationController?.popToRootViewController(animated: true)
 //self.performSegue(withIdentifier: "seque_golf", sender: nil)
 //hidesBottomBarWhenPushed = false
}
override func viewDidLoad() {
super.viewDidLoad()
ref = Database.database().reference()
handle = ref?.child("Girls_golf").observe(.childAdded, with: { 
(snapshot) in
    if let item = snapshot.value as? String {
        self.array.append(item)
        self.tableview_golf.reloadData()
    }

})


}

func tableView(_ tableView: UITableView, numberOfRowsInSection section: 
Int) -> Int {
return array.count
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: 
IndexPath) -> UITableViewCell {
let cell = tableview_golf.dequeueReusableCell(withIdentifier: 
"golf_cell")! as UITableViewCell
cell.textLabel?.text = array[indexPath.row]
cell.textLabel?.numberOfLines = 0
return cell
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}

您似乎已经弹出了 ViewController(在此示例中 "Golf")。如果这是真的,这应该适用于:

@IBAction func back_golf(_ sender: Any) {
    self.dismiss(animated: true, completion: nil)
}