۵۰٪ تخفیف فقط تا پایان جشنواره؛ بعدش همه‌چیز به قیمت قبل برمی‌گرده!

مشاهده دوره‌ها
ثانیه
دقیقه
ساعت
روز
راکت

کارنکردن 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'
}

})

ثبت پرسش جدید

پاسخ‌ها

0

هنوز پاسخی ثبت نشده

اولین نفری باشید که به این پرسش کمک می‌کند و مسیر حل مشکل را باز می‌کند.

اولین پاسخ را بنویسید

شاید پاسخ شما همین‌جا باشد

برای ارسال پاسخ لازم است وارد شده یا ثبت‌نام کنید

ورود یا ثبت‌نام