react-native - 未定义的评估 frames.endCoordinates.height
问题描述
我已将 RN 升级到 0.59.1 并将本机基础更新到 2.13.5。出错
“未定义的frames.endCoordinates.height”
当我尝试textinput
。
Native-Base
内容在内部使用
react-native-keyboard-aware-scroll-view
这是来自KeyboardAwareHOC
的函数react-native-keyboard-aware-scroll-view
_updateKeyboardSpace = (frames: Object) => {
if (this.props.enableAutomaticScroll) {
let keyboardSpace: number =
frames.endCoordinates.height + this.props.extraScrollHeight
if (this.props.viewIsInsideTabBar) {
keyboardSpace -= _KAM_DEFAULT_TAB_BAR_HEIGHT
}
解决方案
你的问题我无法理解你的意图。但你想做的似乎是这样的。
<KeyboardAwareScrollView
onKeyboardWillShow={(frames: Object) => {
console.log('Keyboard event', frames)
}}>
这是正确的吗?您刚刚看到了react-native-keyboard-aware-scroll-view
制作“ ”模块的代码。
推荐阅读
- function - Dart / Flutter 与“对参数使用通用函数类型语法”(use_function_type_syntax_for_parameters)混淆
- python - python中熊猫的高效groupby()编码
- entity-relationship - 如何为不总是存在的 erd 实体创建属性
- python - Python 的双面不等式是如何工作的?为什么它不适用于 numpy 数组?
- reactjs - NextJS:从客户端或服务器端的另一个页面调用存储时,Redux 存储返回空
- python - 将 JSON 文件正确转换为 xls
- c# - 从大多数属性相同的实体框架查询中选择 DTO 对象,有没有更好的方法?
- microsoft-graph-api - 传出 Webhook 响应消息的格式是什么?
- python - 通过元组列表过滤 DataFrame 的行
- javascript - 如何发现不再调用 MediaRecorder.ondataavailble 的问题?