KeyboardAvoidingView not working as expected
up vote
0
down vote
favorite
React Native - KeyboardAvoidingView Problems
This is what I want:
Here is what I'm having currently
Link to my snack if I can get any help : https://snack.expo.io/@dhavaljardosh/keyboardavoidingview
Here is my Code please let me know what do I need to change
<View style={{ marginTop: 24 }}>
<View>
<Header title="Create Event" prop={details} route="Profile" />
</View>
<View>
<View style={styles.topBlock}>
<View style={{ display: "flex", flexDirection: "row" }}>
<Image />
<Text style={{ marginLeft: 10, fontSize: 16, fontWeight: "bold" }}>
{firstName} {lastName}
</Text>
</View>
<View>
<TouchableWithoutFeedback>
<View style={styles.publicButton}>
<Image />
<Text>Public</Text>
</View>
</TouchableWithoutFeedback>
</View>
</View>
<ScrollView>
<KeyboardAvoidingView behaviour={"padding"} enabled style={{
flex: 1,
marginLeft: 10,
marginRight: 10
}}>
<View style={{
borderColor: "black",
borderWidth: 0.4,
borderRadius: 5,
marginTop: 10,
marginBottom: 10
}}>
<Picker style={{ height: 40, width: "100%", borderColor: "black" }} onValueChange={(itemValue, itemIndex)=>
this.setState({ games: itemValue })
}
>
//There are items not listed here
</Picker>
</View>
<View style={{
display: "flex",
flexDirection: "row",
height: 40,
justifyContent: "center",
marginBottom: 10
}}>
<View style={{
width: "60%",
borderColor: "black",
borderWidth: 0.4,
borderRadius: 5,
marginRight: 10
}}>
<Picker style={{ borderColor: "black", height: "100%" }} onValueChange={(itemValue, itemIndex)=>
this.setState({ games: itemValue })
}
>
//Items not listed here
</Picker>
</View>
<View style={{ flex: 1 }}>
<TouchableOpacity style={{
flex: 1,
display: "flex",
alignItems: "center",
justifyContent: "center",
height: 35,
backgroundColor: "royalblue",
borderRadius: 7,
elevation: 3
}}>
<Text style={{ color: "white" }}>Create List</Text>
</TouchableOpacity>
</View>
</View>
<View style={{ marginBottom: 10 }}>
<TextInput placeholder="Opponent Team Name" style={{
borderColor: "black",
borderWidth: 0.4,
borderRadius: 5,
height: 40,
paddingLeft: 5,
color: "black"
}} underlineColorAndroid="transparent" />
</View>
<View style={{ height: 40, marginBottom:10 }}>
<DatePicker />
</View>
<View>
<GooglePlacesAutocomplete />
</View>
<View style={{ marginBottom: 10 }}>
<TextInput />
</View>
<View style={{ marginBottom: 10 }}>
<TextInput />
</View>
</KeyboardAvoidingView>
</ScrollView>
</View>
</View>
Even was searching for "Keyboard Aware Scroll View" and also a really good article on Avoiding Keyboard View, but wasn't able to understand it totally.
Any help is appreciated.
javascript react-native
add a comment |
up vote
0
down vote
favorite
React Native - KeyboardAvoidingView Problems
This is what I want:
Here is what I'm having currently
Link to my snack if I can get any help : https://snack.expo.io/@dhavaljardosh/keyboardavoidingview
Here is my Code please let me know what do I need to change
<View style={{ marginTop: 24 }}>
<View>
<Header title="Create Event" prop={details} route="Profile" />
</View>
<View>
<View style={styles.topBlock}>
<View style={{ display: "flex", flexDirection: "row" }}>
<Image />
<Text style={{ marginLeft: 10, fontSize: 16, fontWeight: "bold" }}>
{firstName} {lastName}
</Text>
</View>
<View>
<TouchableWithoutFeedback>
<View style={styles.publicButton}>
<Image />
<Text>Public</Text>
</View>
</TouchableWithoutFeedback>
</View>
</View>
<ScrollView>
<KeyboardAvoidingView behaviour={"padding"} enabled style={{
flex: 1,
marginLeft: 10,
marginRight: 10
}}>
<View style={{
borderColor: "black",
borderWidth: 0.4,
borderRadius: 5,
marginTop: 10,
marginBottom: 10
}}>
<Picker style={{ height: 40, width: "100%", borderColor: "black" }} onValueChange={(itemValue, itemIndex)=>
this.setState({ games: itemValue })
}
>
//There are items not listed here
</Picker>
</View>
<View style={{
display: "flex",
flexDirection: "row",
height: 40,
justifyContent: "center",
marginBottom: 10
}}>
<View style={{
width: "60%",
borderColor: "black",
borderWidth: 0.4,
borderRadius: 5,
marginRight: 10
}}>
<Picker style={{ borderColor: "black", height: "100%" }} onValueChange={(itemValue, itemIndex)=>
this.setState({ games: itemValue })
}
>
//Items not listed here
</Picker>
</View>
<View style={{ flex: 1 }}>
<TouchableOpacity style={{
flex: 1,
display: "flex",
alignItems: "center",
justifyContent: "center",
height: 35,
backgroundColor: "royalblue",
borderRadius: 7,
elevation: 3
}}>
<Text style={{ color: "white" }}>Create List</Text>
</TouchableOpacity>
</View>
</View>
<View style={{ marginBottom: 10 }}>
<TextInput placeholder="Opponent Team Name" style={{
borderColor: "black",
borderWidth: 0.4,
borderRadius: 5,
height: 40,
paddingLeft: 5,
color: "black"
}} underlineColorAndroid="transparent" />
</View>
<View style={{ height: 40, marginBottom:10 }}>
<DatePicker />
</View>
<View>
<GooglePlacesAutocomplete />
</View>
<View style={{ marginBottom: 10 }}>
<TextInput />
</View>
<View style={{ marginBottom: 10 }}>
<TextInput />
</View>
</KeyboardAvoidingView>
</ScrollView>
</View>
</View>
Even was searching for "Keyboard Aware Scroll View" and also a really good article on Avoiding Keyboard View, but wasn't able to understand it totally.
Any help is appreciated.
javascript react-native
try playing with this implementation snack.expo.io/ryxRkwnrW
– Haider Ali
Nov 9 at 22:45
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
React Native - KeyboardAvoidingView Problems
This is what I want:
Here is what I'm having currently
Link to my snack if I can get any help : https://snack.expo.io/@dhavaljardosh/keyboardavoidingview
Here is my Code please let me know what do I need to change
<View style={{ marginTop: 24 }}>
<View>
<Header title="Create Event" prop={details} route="Profile" />
</View>
<View>
<View style={styles.topBlock}>
<View style={{ display: "flex", flexDirection: "row" }}>
<Image />
<Text style={{ marginLeft: 10, fontSize: 16, fontWeight: "bold" }}>
{firstName} {lastName}
</Text>
</View>
<View>
<TouchableWithoutFeedback>
<View style={styles.publicButton}>
<Image />
<Text>Public</Text>
</View>
</TouchableWithoutFeedback>
</View>
</View>
<ScrollView>
<KeyboardAvoidingView behaviour={"padding"} enabled style={{
flex: 1,
marginLeft: 10,
marginRight: 10
}}>
<View style={{
borderColor: "black",
borderWidth: 0.4,
borderRadius: 5,
marginTop: 10,
marginBottom: 10
}}>
<Picker style={{ height: 40, width: "100%", borderColor: "black" }} onValueChange={(itemValue, itemIndex)=>
this.setState({ games: itemValue })
}
>
//There are items not listed here
</Picker>
</View>
<View style={{
display: "flex",
flexDirection: "row",
height: 40,
justifyContent: "center",
marginBottom: 10
}}>
<View style={{
width: "60%",
borderColor: "black",
borderWidth: 0.4,
borderRadius: 5,
marginRight: 10
}}>
<Picker style={{ borderColor: "black", height: "100%" }} onValueChange={(itemValue, itemIndex)=>
this.setState({ games: itemValue })
}
>
//Items not listed here
</Picker>
</View>
<View style={{ flex: 1 }}>
<TouchableOpacity style={{
flex: 1,
display: "flex",
alignItems: "center",
justifyContent: "center",
height: 35,
backgroundColor: "royalblue",
borderRadius: 7,
elevation: 3
}}>
<Text style={{ color: "white" }}>Create List</Text>
</TouchableOpacity>
</View>
</View>
<View style={{ marginBottom: 10 }}>
<TextInput placeholder="Opponent Team Name" style={{
borderColor: "black",
borderWidth: 0.4,
borderRadius: 5,
height: 40,
paddingLeft: 5,
color: "black"
}} underlineColorAndroid="transparent" />
</View>
<View style={{ height: 40, marginBottom:10 }}>
<DatePicker />
</View>
<View>
<GooglePlacesAutocomplete />
</View>
<View style={{ marginBottom: 10 }}>
<TextInput />
</View>
<View style={{ marginBottom: 10 }}>
<TextInput />
</View>
</KeyboardAvoidingView>
</ScrollView>
</View>
</View>
Even was searching for "Keyboard Aware Scroll View" and also a really good article on Avoiding Keyboard View, but wasn't able to understand it totally.
Any help is appreciated.
javascript react-native
React Native - KeyboardAvoidingView Problems
This is what I want:
Here is what I'm having currently
Link to my snack if I can get any help : https://snack.expo.io/@dhavaljardosh/keyboardavoidingview
Here is my Code please let me know what do I need to change
<View style={{ marginTop: 24 }}>
<View>
<Header title="Create Event" prop={details} route="Profile" />
</View>
<View>
<View style={styles.topBlock}>
<View style={{ display: "flex", flexDirection: "row" }}>
<Image />
<Text style={{ marginLeft: 10, fontSize: 16, fontWeight: "bold" }}>
{firstName} {lastName}
</Text>
</View>
<View>
<TouchableWithoutFeedback>
<View style={styles.publicButton}>
<Image />
<Text>Public</Text>
</View>
</TouchableWithoutFeedback>
</View>
</View>
<ScrollView>
<KeyboardAvoidingView behaviour={"padding"} enabled style={{
flex: 1,
marginLeft: 10,
marginRight: 10
}}>
<View style={{
borderColor: "black",
borderWidth: 0.4,
borderRadius: 5,
marginTop: 10,
marginBottom: 10
}}>
<Picker style={{ height: 40, width: "100%", borderColor: "black" }} onValueChange={(itemValue, itemIndex)=>
this.setState({ games: itemValue })
}
>
//There are items not listed here
</Picker>
</View>
<View style={{
display: "flex",
flexDirection: "row",
height: 40,
justifyContent: "center",
marginBottom: 10
}}>
<View style={{
width: "60%",
borderColor: "black",
borderWidth: 0.4,
borderRadius: 5,
marginRight: 10
}}>
<Picker style={{ borderColor: "black", height: "100%" }} onValueChange={(itemValue, itemIndex)=>
this.setState({ games: itemValue })
}
>
//Items not listed here
</Picker>
</View>
<View style={{ flex: 1 }}>
<TouchableOpacity style={{
flex: 1,
display: "flex",
alignItems: "center",
justifyContent: "center",
height: 35,
backgroundColor: "royalblue",
borderRadius: 7,
elevation: 3
}}>
<Text style={{ color: "white" }}>Create List</Text>
</TouchableOpacity>
</View>
</View>
<View style={{ marginBottom: 10 }}>
<TextInput placeholder="Opponent Team Name" style={{
borderColor: "black",
borderWidth: 0.4,
borderRadius: 5,
height: 40,
paddingLeft: 5,
color: "black"
}} underlineColorAndroid="transparent" />
</View>
<View style={{ height: 40, marginBottom:10 }}>
<DatePicker />
</View>
<View>
<GooglePlacesAutocomplete />
</View>
<View style={{ marginBottom: 10 }}>
<TextInput />
</View>
<View style={{ marginBottom: 10 }}>
<TextInput />
</View>
</KeyboardAvoidingView>
</ScrollView>
</View>
</View>
Even was searching for "Keyboard Aware Scroll View" and also a really good article on Avoiding Keyboard View, but wasn't able to understand it totally.
Any help is appreciated.
javascript react-native
javascript react-native
asked Nov 9 at 20:57
Dhaval Jardosh
3,5712934
3,5712934
try playing with this implementation snack.expo.io/ryxRkwnrW
– Haider Ali
Nov 9 at 22:45
add a comment |
try playing with this implementation snack.expo.io/ryxRkwnrW
– Haider Ali
Nov 9 at 22:45
try playing with this implementation snack.expo.io/ryxRkwnrW
– Haider Ali
Nov 9 at 22:45
try playing with this implementation snack.expo.io/ryxRkwnrW
– Haider Ali
Nov 9 at 22:45
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233181%2fkeyboardavoidingview-not-working-as-expected%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
try playing with this implementation snack.expo.io/ryxRkwnrW
– Haider Ali
Nov 9 at 22:45