show 2 items per row[react native]

后端 未结 5 1226
借酒劲吻你
借酒劲吻你 2020-12-15 17:40

I am learning react native and in all the tutorials i see ListView has been used with only 1 items per row. I have not used ListView, though. I have only 6 items that has to

5条回答
  •  孤城傲影
    2020-12-15 18:20

    The correct way to do it would be with flexBasis, with a value set to (1/n)% where n is the desired # of rows > 0. For two rows:

    .parent {
        flex: 1;
        flexWrap: 'wrap';
        flexDirecton: 'row';
    }
    .child {
        flexBasis: '50%';
    }
    

提交回复
热议问题