Lady Relax
5 سال پیش توسط Lady Relax مطرح شد
0 پاسخ

کارنکردن scroll در memu play

سلام وقت بخیر من خروجی میتونم بگیرم در ریکت نیتیو ولی در <FlatList> و <SectionList> صفحه Scroll نمیشه !
از Memu play استفاده میکنم ولی تو خود <ScrollView> صفحه Scroll میشه!
اینم کدام:
import React, {Component} from 'react';
import {Text,View,StyleSheet,Image,FlatList, SectionList} from 'react-native';

export default class App extends Component {

render(){
return(
<SectionList
sections={[
{
title: 'firstname',
data: [
{ text: 'sevda',
image: 'https://static.roocket.ir/images/cover/2021/5/1/Tl0uGGj7BVocVBVou5jD0TG22cgl3mcNeecYpsxi.png'
},
{ text: 'sevda',
image: 'https://static.roocket.ir/images/cover/2021/5/1/Tl0uGGj7BVocVBVou5jD0TG22cgl3mcNeecYpsxi.png'
},
{ text: 'sevda',
image: 'https://static.roocket.ir/images/cover/2021/5/1/Tl0uGGj7BVocVBVou5jD0TG22cgl3mcNeecYpsxi.png'
}
]
},
{
title: 'secondname',
data: [
{ text: 'sevda',
image: 'https://static.roocket.ir/images/cover/2021/5/1/Tl0uGGj7BVocVBVou5jD0TG22cgl3mcNeecYpsxi.png'
},
{ text: 'sevda',
image: 'https://static.roocket.ir/images/cover/2021/5/1/Tl0uGGj7BVocVBVou5jD0TG22cgl3mcNeecYpsxi.png'
},
{ text: 'sevda',
image: 'https://static.roocket.ir/images/cover/2021/5/1/Tl0uGGj7BVocVBVou5jD0TG22cgl3mcNeecYpsxi.png'
}
]
}
]}

  renderItem={({ item }) => ( 
    <View >
      <Image 
      source={{
        uri: item.image,
        width:300,
        height:200,
      }}
      />
      <Text style={styles.text}>{item.text}</Text>
    </View>
  )}
  renderSectionHeader={({ section }) => (
    <Text style={styles.section}>{section.title}</Text>
  )}
  keyExtractor={( item, index) => index}
  />

);

}

}
const styles = StyleSheet.create({
container:{
backgroundColor:'#865123',
padding:20,
margin:5,
alignItems: 'center'

},
text:{
padding:20,
fontSize:18,
},
image :{
margin:20
},
section:{
fontSize:18,
backgroundColor:'#821547'
}

})