键盘AvoidingView中有一个"行为"属性,例如:
import { KeyboardAvoidingView } from 'react-native';
<KeyboardAvoidingView style={styles.container} behavior="padding" enabled>
... your UI ...
</KeyboardAvoidingView>
它可以 Select 为三个选项之一:'height'
、'position'
或'padding'
.这种差异没有得到in the documentation%的解释.它只说不需要设置属性,并且有一个注释:
Note: Android and iOS both interact with this prop differently. Android may behave better when given no behavior prop at all, whereas iOS is the opposite.
这些设置应该有什么影响?