【发布时间】:2018-11-11 10:49:19
【问题描述】:
我像这样在tabBar上方添加ViewController
cardViewController = storyboard?.instantiateViewController(withIdentifier: "CardViewController") as? CardViewController
addChildViewController(cardViewController)
cardViewController.didMove(toParentViewController: self)
view.addSubview(cardViewController.view)
cardViewController.view.frame = CGRect(x: 0, y: view.frame.height - cardHandlAreaHight - tabBarHight,
width: view.bounds.width, height: cardHight)
cardViewController.view.clipsToBounds = true
我得到的 tabBar 的大小是这样的:
tabBarHight = tabBarController?.tabBar.frame.size.height
这适用于所有 iPhone,但不适用于 iPhone X 如何解决这个问题?
【问题讨论】:
-
你试过约束吗?
-
为什么还要它的高度?
-
@Vyacheslav 没有。这是卡片视图,也就是此视图的底部表单。