2017-05-27 65 views
0

我有我的react-native應用程序中的渲染功能返回以下代碼。 container將其flex屬性設置爲1.反應原生滾動視圖不滾動

即使內容溢出,滾動也不起作用。我究竟做錯了什麼?

還嘗試將flex設置爲ScrollView設置爲1.仍然不起作用。

<View style={globalStyle.container}> 
      {flashMessage} 
      <ScrollView> 
      <View style={globalStyle.header}> 
       <Text style={globalStyle.title}> {localization.categories} </Text> 
      </View> 
      <ListView style={{marginTop: 10}} 
       dataSource={this.state.dataSource} 
       renderRow={(rowData, sectionID, rowID)=> this.renderRow(rowData, sectionID, rowID)} 
      /> 
      </ScrollView> 
      <View style={{position: 'absolute', height: 70, left: 0, right: 0, bottom: 0, flexDirection:'row', justifyContent:'center'}}> 
      <TouchableHighlight style={globalStyle.footer} onPress={() => { this.redirect('home'); }} > 
       <View> 
       <Image style={globalStyle.footerIcons} source={require('./Thumbnails/ -button-selected.png')}/> 
       <Text style={globalStyle.footerText,globalStyle.selected} > {localization.meditate} </Text> 
       </View> 
      </TouchableHighlight> 
      <TouchableHighlight style={globalStyle.footer} onPress={() => { this.redirect('profile');}} > 
       <View> 
       <Image style={globalStyle.footerIcons} source={require('./Thumbnails/user.png')} /> 
       <Text style={globalStyle.footerText} > {localization.me} </Text> 
       </View> 
      </TouchableHighlight> 
      <TouchableHighlight style={globalStyle.footer} onPress={() => { this.redirect('settings');}}> 
       <View> 
       <Image style={globalStyle.footerIcons} source={require('./Thumbnails/settings.png')} /> 
       <Text style={globalStyle.footerText} > {localization.settings} </Text> 
       </View> 
      </TouchableHighlight> 
      </View> 
     </View> 

回答

1

我相信你不應該在ScrollView中使用ListView。 可以使用renderHeader功能,並把有 你的頭:

<View style={globalStyle.header}> 
    <Text style={globalStyle.title}> {localization.categories} </Text> 
</View>