【问题标题】:Hiding bottom tab bar before master object select在主对象选择之前隐藏底部标签栏
【发布时间】:2019-01-08 06:03:22
【问题描述】:

Xcode 10.1 斯威夫特 4.2

我正在使用主从项目。我需要在详细视图中添加一个底部选项卡栏,但我不希望在选择主视图中的对象之前显示它。

现在我使用“绘图”下的“隐藏”选项作为选项卡栏,该选项在初始启动期间将其隐藏,但在选择主对象后找不到使其显示的方法。

class DetailViewController: UIViewController {

    @IBOutlet weak var detailHeaderLabel: UINavigationItem!
    @IBOutlet weak var detailDescriptionLabel: UILabel!

    func configureView() {
        // Update the user interface for the detail item.
        if let detail = detailItem {
            if let label = detailDescriptionLabel {
                label.text = detail.description
            }
            if let headerLabel = detailHeaderLabel {
                headerLabel.title = detail.description
            }
        }
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        configureView()
    }

    var detailItem: String? {
        didSet {
            // Update the view.
            configureView()
        }
    }


}

【问题讨论】:

  • 它是 iPad 应用吗?
  • @mihirmehta 是的,我确实打算为 iPhone 创建一个类似的,但具有相似的方面。

标签: ios swift uitabbar


【解决方案1】:

您需要从情节提要创建选项卡栏的 IBOutlet 并且更改是隐藏属性

DispatchQueue.global(qos: .background).async {
    // Background Thread
    getObjectForMaster()
    DispatchQueue.main.async {
        tabBar.isHidden = false
    }
}

【讨论】:

  • 这工作:) 非常感谢您的快速和有益的回应。我还在学习。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-09-28
  • 2020-08-26
  • 2019-11-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多