苹果键盘适配
This commit is contained in:
@@ -134,9 +134,17 @@
|
||||
reply_data.parentBbsId = parentBbsId
|
||||
reply_data.bbsId = item.bbsId
|
||||
reply_data.index = index
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
// 安全区域底部到屏幕底部的高度(即底部安全区域高度)
|
||||
const safeAreaBottomHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom;
|
||||
nextTick(() => {
|
||||
uni.onKeyboardHeightChange(res => {
|
||||
popup_input_bottom.value = `${res.height}px`;
|
||||
let keyboardHeight = res.height;
|
||||
// 仅在iOS端补偿安全区域高度
|
||||
if (systemInfo.platform === 'ios') {
|
||||
keyboardHeight = Math.max(0, keyboardHeight - safeAreaBottomHeight); // 避免负数
|
||||
}
|
||||
popup_input_bottom.value = `${keyboardHeight}px`;
|
||||
console.log(res);
|
||||
});
|
||||
})
|
||||
@@ -230,7 +238,7 @@
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.popup {
|
||||
z-index: 1200;
|
||||
z-index: 18000;
|
||||
}
|
||||
|
||||
.empty_message_div {
|
||||
|
||||
Reference in New Issue
Block a user