【发布时间】: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 创建一个类似的,但具有相似的方面。