我试图阻止键盘阻止iOS上的输入,我意识到使用android我可以做类似设置android:windowSoftInputMode =" adjustPan"在你的清单文件中实现这一点。
但是我遇到了一些问题:
我尝试过:
<Form>
<KeyboardAvoidingView
behavior="padding" >
<FieldsContainer>
<Fieldset label = "Edit Profile">
<Input name = "name"
label = "Name"
placeholder = "Jane Doe" />
<Select
name = "gender"
label = "Gender"
options = {genderOptions}
placeholder = "Male"
/>
<Select
name="bodyType"
label="Body Type"
options={bodyTypeOptions}
placeholder="Mesomorph"
/>
<Select
name = "location"
label = "Location"
options = {locationOptions}
placeholder = "Central"
/>
<Input name="bio" label="Bio" placeholder="" multiline={true} numberOfLines={3} inlineLabel={false} />
</Fieldset>
</FieldsContainer>
</KeyboardAvoidingView>
<ActionSheetContainer />
<Button
onPress={handleSubmit(this.submit.bind(this))}
> Submit </Button>
<SuccessMessage
success = {submitSucceeded} />
</Form>
视图根本不滚动。
答案 0 :(得分:0)
您可以尝试react-native-keyboard-aware-scroll-view
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'
<KeyboardAwareScrollView>
<View>
<TextInput />
</View>
</KeyboardAwareScrollView>