React Native - Flatlist с независимым столбцом - PullRequest
0 голосов
/ 30 апреля 2019

Я хотел бы сделать независимый столбец плоским списком, как я могу сделать так, чтобы нацеленный статус?

Текущий статус:

https://imgur.com/a/gKAt3XK

Направленный статус:

https://imgur.com/a/STgzjb8

<FlatList
            ref={(list) => this.myFlatList = list}  
            numColumns={2}   
            columnWrapperStyle={{justifyContent:'space-between'}}
            data={this.state.products}
            renderItem={({item, separators})=>(
                <View key={item.key}>
                <TouchableOpacity style={{width:WIDTH/2,flexDirection:"row",alignItems:"center",justifyContent:"center",marginTop:20}}>
                    <AutoHeightImage width={WIDTH/2.2} style={{borderRadius:10}} source={item.uri != undefined ? {uri:url.getURL()+"/"+item.uri} : require('../../img/product.jpg')}/>
                    <View style={{position:"absolute",bottom:10,backgroundColor:"rgba(0,0,0,0.4)",width:WIDTH/2.2,flexDirection:"row",alignItems:"center",paddingHorizontal:5}}>
                        <Text style={{width:70+"%",color:"white",fontSize:WIDTH*0.040,fontWeight:"500"}} numberOfLines={1}>{item.name}</Text>
                        {/*<Text style={{width:30+"%",color:"white",fontSize:WIDTH*0.035,fontWeight:"500",textAlign:"right"}}>{item.price+" TL"}</Text>*/}
                    </View>
                </TouchableOpacity>

                </View>
            )}
            //onEndReached={this.getoldmessages}
            //onEndReachedThreshold={0.5}
            removeClippedSubviews={true} 
            refreshing={this.state.refreshing}  
            onRefresh={this.handleRefresh}  
            extraData={this.state}   
            />
...