Я использую ToolbarController из Material Framework от cosmicmind в swift 3. У меня есть два UIViews в этом контроллере, один вверху, а другой внизу экрана. Нижний UIView не отображается в контроллере. Я думаю, что это перемещается вниз по экрану.
Эта проблема возникает при тестировании с реальным устройством. В остальном симулятор показывает правильное поведение.
import UIKit
import Material
class RootViewController: UIViewController {
open override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = Color.white
prepareToolbar()
handleTopView()
handleBottomView()
}
func handleTopView() {
let topView = UIView()
topView.frame = CGRect(x: 0.00, y: 0.00, width: view.frame.size.width, height: 40.00)
topView.backgroundColor = UIColor.gray
view.addSubview(topView)
}
func handleBottomView() {
let bottomView = UIView()
bottomView.frame = CGRect(x: 0.00, y: self.view.frame.size.height, width: view.frame.size.width, height: 40.00)
bottomView.backgroundColor = UIColor.blue
view.addSubview(bottomView)
}
}
extension RootViewController {
fileprivate func prepareToolbar() {
guard let toolbar = toolbarController?.toolbar else {
return
}
toolbar.title = "Material"
toolbar.titleLabel.textColor = .white
toolbar.titleLabel.textAlignment = .left
toolbar.detail = "Build Beautiful Software"
toolbar.detailLabel.textColor = .white
toolbar.detailLabel.textAlignment = .left
}
}