KeyboardAvoidingView not working as expected











up vote
0
down vote

favorite












React Native - KeyboardAvoidingView Problems



This is what I want:



enter image description here



Here is what I'm having currently



enter image description here



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.










share|improve this question






















  • try playing with this implementation snack.expo.io/ryxRkwnrW
    – Haider Ali
    Nov 9 at 22:45















up vote
0
down vote

favorite












React Native - KeyboardAvoidingView Problems



This is what I want:



enter image description here



Here is what I'm having currently



enter image description here



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.










share|improve this question






















  • try playing with this implementation snack.expo.io/ryxRkwnrW
    – Haider Ali
    Nov 9 at 22:45













up vote
0
down vote

favorite









up vote
0
down vote

favorite











React Native - KeyboardAvoidingView Problems



This is what I want:



enter image description here



Here is what I'm having currently



enter image description here



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.










share|improve this question













React Native - KeyboardAvoidingView Problems



This is what I want:



enter image description here



Here is what I'm having currently



enter image description here



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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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


















  • 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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Schultheiß

Liste der Kulturdenkmale in Wilsdruff

Android Play Services Check