react-native-flexbox

React Native: Make Each Child of ScrollView Full Height

余生长醉 提交于 2021-02-11 12:14:27
问题 I have a ScrollView which has two children, and I want each of the children to be the full height of the available space on the screen, meaning view 1 fills the whole screen, and then I scroll down to start to see part of slide 2. If I scroll all the way down, I should only see slide 2. I can't figure out how to get this to happen. What is currently happening is that each child is filling half of the available vertical space, so I don't get any scrolling. Any ideas how I can achieve this

Flex direction: row-reverse in react-native

独自空忆成欢 提交于 2019-12-19 08:28:35
问题 How can i reproduce flex-direction: row-reverse in React-Native? When in element' style i'm doing: flexDirection: 'row-reverse' i'm getting error: Invalid prop flexDirection of value row-reverse supplied to StyleSheet UPDATE: They just added it in version 0.29.0 :) 回答1: UPDATE As of v29, React Native provides support for reverse flex directions in Android and iOS. https://github.com/facebook/react-native/releases/tag/v0.29.0 ORIGINAL ANSWER There is no row-reverse or column-reverse in react

React Native <Text> overflows <View> when in a flex

一曲冷凌霜 提交于 2019-12-12 11:55:48
问题 So for the above image, I am attempting to get the "green" box to wrap around the dynamic text. Notice how the blue and yellow text boxes are in a flex: 'row' configuration, and the blue box of text is at a flex: 2 and the yellow is flex: 1 . Things work fine until the text is too big for the parent container. I'd like for the green container to grow as needed to fit the flexed inner children. Is this possible with react native? Here's an image of what it looks like in a web sense: I've tried

React-Native Flexbox - Position One Item at Vertical Center and other at Bottom

邮差的信 提交于 2019-12-12 01:25:56
问题 Within a parent view, I would like to vertically center align one piece of text and have another at the bottom of the view.Whenever I add the bottom text, it shifts the position of the vertical centered view upwards (to make it the vertical center of the remaining space). How do I keep the text vertically centered align relative to the parent view? Update: I understand I can do this using {position: 'absolute', bottom:0}, but want to understand the flex-box solution. <View style={{height: 300

Make an item stick to the bottom using flex in react-native

余生长醉 提交于 2019-11-30 07:49:58
Suppose this is the layout: <View style={styles.container}> <View style={styles.titleWrapper}> ... ... </View> <View style={styles.inputWrapper}> ... ... </View> <View style={styles.footer}> <TouchableOpacity> <View style={styles.nextBtn}> <Text style={styles.nextBtnText}>Next</Text> </View> </TouchableOpacity> </View> </View> I want to make the view with the styles of footer to position at the bottom of the screen. I tried giving the alignSelf property to the footer, but instead of positioning at the bottom, it positions it to the right side of the screen. How can I make the footer item stick

React-native: how to wrap FlatList items

Deadly 提交于 2019-11-30 01:01:29
问题 I have a list of Terms that are returned by a query. Each is a single word. Currently my FlatList renders each word into a button on the same row (horizontal={true}) I would like the buttons to wrap like normal text would. But I absolutely do not want to use the column feature, because that would not look as natural. Is this possibly a bad use-case for FlatList? Are there any other components I could use? const styles = StyleSheet.create({ flatlist: { flexWrap: 'wrap' }, content: { alignItems

Make an item stick to the bottom using flex in react-native

北城以北 提交于 2019-11-29 05:46:23
问题 Suppose this is the layout: <View style={styles.container}> <View style={styles.titleWrapper}> ... ... </View> <View style={styles.inputWrapper}> ... ... </View> <View style={styles.footer}> <TouchableOpacity> <View style={styles.nextBtn}> <Text style={styles.nextBtnText}>Next</Text> </View> </TouchableOpacity> </View> </View> I want to make the view with the styles of footer to position at the bottom of the screen. I tried giving the alignSelf property to the footer, but instead of