【问题标题】:React Native Scrollview not scrollingReact Native Scrollview 不滚动
【发布时间】:2018-09-04 04:37:38
【问题描述】:
<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>

您好,我有这个代码,但幸运的是它没有滚动菜单可能是什么问题,请帮助

【问题讨论】:

    标签: javascript android reactjs react-native


    【解决方案1】:

    Yes 跟随滚动视图的过程:它将在内部循环的视图列表上工作。所以你需要这样做。

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

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

    【讨论】:

      猜你喜欢
      • 2019-07-16
      • 2018-04-09
      • 1970-01-01
      • 2019-07-18
      • 2021-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-30
      相关资源
      最近更新 更多