例如,有一个页脚,我希望键盘隐藏它。现在我有这样的事情:
我需要做什么?
PS:我使用的是native-base。
答案 0 :(得分:1)
至少你必须尝试使用一些代码! - 见How To Ask
任何方式,你必须import { Keyboard } from "react-native";
并添加监听器。只要键盘打开,就隐藏页脚。
类似的东西:
componentDidMount () {
this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
}
componentWillUnmount () {
this.keyboardDidShowListener.remove();
this.keyboardDidHideListener.remove();
}
_keyboardDidShow () {
// change the state of showFooter to false
}
_keyboardDidHide () {
// change the state of showFooter to true
}