'''
lettopView =UIView.init()
letbottom =UIView.init()
letmiddle =UIView.init()
topView.backgroundColor = UIColor.green
bottom.backgroundColor = UIColor.green
middle.backgroundColor=UIColor.red
self.view.addSubview(topView)
self.view.addSubview(middle)
self.view.addSubview(bottom)
topView.mas_makeConstraints{ (make)in
make?.left.right().equalTo()(self.view)
if#available(iOS11.0, *) {
print(self.view.mas_safeAreaLayoutGuideTop)
make?.top.equalTo()(self.view.mas_safeAreaLayoutGuideTop)
}else{
make?.top.equalTo()(self.mas_topLayoutGuide)
}
make?.height.equalTo()(100)
}
middle.mas_makeConstraints{ (make)in
make?.left.equalTo()(self.view)?.setOffset(15)
make?.right.equalTo()(self.view)?.setOffset(-15)
make?.top.equalTo()(topView.mas_bottom)
make?.bottom.equalTo()(bottom.mas_topMargin)?.setOffset(-15)
}
bottom.mas_makeConstraints{ (make)in
make?.left.equalTo()(self.view)?.setOffset(30)
make?.right.equalTo()(self.view)?.setOffset(-30)
make?.height.equalTo()(200)
if#available(iOS11.0, *) {
make?.bottom.equalTo()(self.view.mas_safeAreaLayoutGuideBottom)
print(self.view.mas_safeAreaLayoutGuideBottom)
}else{
// Fallback on earlier versions
make?.bottom.equalTo()(self.bottomLayoutGuide);
}
}
'''
网友评论