ScrollView 中的 bounded height 是什么?

问题描述 投票:0回答:1

什么意思? (https://facebook.github.io/react-native/docs/scrollview

请记住,ScrollViews 必须有一个有界的高度才能工作

谁非要有所谓的有界身高

ScrollView
本身?还是它的父母?还是它的孩子?

<SafeAreaView style={{height: ...}}> <= this?
    <ScrollView style={{height: ...}}> <= this?
        <View style={{height: ...}}> <= this?
            ....
        </View>
    </ScrollView>
</SafeAreaView>
react-native layout markup yoga-x1
1个回答
0
投票

据我所知,它是 ScrollView 父级的高度。

<SafeAreaView style={styles.container}>
  <ScrollView style={styles.scrollView}>
     ......
     ......
  </ScrollView>
</SafeAreaView>

const styles = StyleSheet.create({
     container: {
       flex: 1,
     },
© www.soinside.com 2019 - 2024. All rights reserved.