-1

从服务器映射数据的代码:

{
  this.state.items.map((item, key) => (

    <View style= { styles.row } >    
    <View style={ [styles.inputWrap, styles.inputWrap2]} >
    <TouchableOpacity onPress={ this.FunctionToOpenitempage } >
    <Card>
    <CardItem>
    <Body>
    <Image style={{ resizeMode: 'cover' }} source={{ 
      uri: ("http://suburbiya.com/assets/files/item_gallery/" + item.banner_pic)
           .replace(" ", "%20") 
       }} style = { styles.logo1 } />
      <Text style={ styles.Text2 }>
        { item.price }
        < /Text>
        < Text style = { styles.Text2 } >

          { item.name }
          < /Text>
          < /Body>
          < /CardItem></Card >
          </TouchableOpacity></View > 
    </View>          
  ))}

样式编码:

row: {
    flexDirection: "row",
    flexWrap:"wrap",

  inputWrap: {
    flex:1,
    borderColor: "#cccccc",
    borderBottomWidth: 0,
    marginBottom: 0,
    marginLeft: 2,
    justifyContent:"space-between",
  },
 }

它连续只显示一张牌

4

1 回答 1

0

如果您想连续对齐两张卡片,请在每种卡片样式中设置此样式:

cardstyle:{flex:1,height:50}
于 2018-08-19T07:36:09.410 回答