React Native Scrollview不滚动

时间:2018-03-26 05:38:11

标签: javascript android reactjs react-native

<Native.ImageBackground source={props.background ? props.background : background} resizeMode={props.background ? 'cover' : 'repeat'} imageStyle={{width: '100%', height: '100%'}}>
    <Native.StatusBar barStyle="light-content" />
    <Native.View style={{flex: 1}}>
      <Native.ScrollView contentContainerStyle={{flexGrow: 1}}>
        <Native.View style={{flex: 1}}>
          <Components.RestaurantMenu
            menuPassed={this.state.menuReceived[0]}
            orderChange={this.orderObjectChange}
            orderObject={this.state.orderObject}
          />
        </Native.View>
      </Native.ScrollView>
    </Native.View>
</Native.ImageBackground>

你好我有这个代码,但幸运的是不滚动菜单可能是什么问题,请帮忙

1 个答案:

答案 0 :(得分:0)

是按照滚动视图的过程:它将处理内部循环视图列表。所以你需要这样做。

<ScrollView> 
 <View style={{flex : 1}}>
    <View>
      <Text>Any text Here </Text>
    </View>
    <View>
      <Text>Any text 2 Here </Text>
    </View>
</View>
</ScrollView>

从所有其他视图中设置scrollview,然后尝试:)