动态化高度比例
This commit is contained in:
@@ -29,23 +29,24 @@
|
||||
self.topBar = [[KBToolBar alloc] init];
|
||||
self.topBar.delegate = self;
|
||||
[self addSubview:self.topBar];
|
||||
// 键盘区域
|
||||
// 键盘区域(高度按照设计值做等比缩放,避免不同机型上按键被压缩/拉伸)
|
||||
CGFloat keyboardAreaHeight = KBFit(200.0f);
|
||||
CGFloat bottomInset = KBFit(4.0f);
|
||||
CGFloat barSpacing = KBFit(6.0f);
|
||||
|
||||
self.keyboardView = [[KBKeyboardView alloc] init];
|
||||
self.keyboardView.delegate = self;
|
||||
[self addSubview:self.keyboardView];
|
||||
[self.keyboardView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self);
|
||||
// make.top.equalTo(self.topBar.mas_bottom).offset(4);
|
||||
make.height.mas_equalTo(200);
|
||||
make.bottom.equalTo(self.mas_bottom).offset(-4);
|
||||
make.height.mas_equalTo(keyboardAreaHeight);
|
||||
make.bottom.equalTo(self.mas_bottom).offset(-bottomInset);
|
||||
}];
|
||||
|
||||
|
||||
|
||||
[self.topBar mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self);
|
||||
make.top.equalTo(self.mas_top).offset(0);
|
||||
// make.height.mas_equalTo(40);
|
||||
make.bottom.equalTo(self.keyboardView.mas_top).offset(-6);
|
||||
make.bottom.equalTo(self.keyboardView.mas_top).offset(-barSpacing);
|
||||
}];
|
||||
|
||||
// 功能面板切换交由外部控制器处理;此处不直接创建/管理
|
||||
|
||||
Reference in New Issue
Block a user