2017-07-16 94 views
0

我想阻止鍵盤在iOS上阻止輸入,我知道,與Android我可以做一些像你的清單文件中設置android:windowSoftInputMode =「adjustPan」來實現這一點。KeyboardAvoidingView或替代品

但是這裏有一些問題,我遇到:

  • KeyboardAvoidingView似乎不具有終極版形式工作
  • 項目目前在博覽會上,可能必須分離辦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

你可以嘗試react-native-keyboard-aware-scroll-view

import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view' 

<KeyboardAwareScrollView> 
    <View> 
    <TextInput /> 
    </View> 
</KeyboardAwareScrollView> 
+0

嘗試過,但不具有終極版形式以及工作 –