无法在React Native中使组件与flexDirection水平对齐

时间:2019-06-01 04:04:02

标签: react-native

我正在数组上映射,以将受支撑状态转换为许多组件。

当我这样做时,我会收到一列垂直的组件,而不是水平的,就像您对flexDirection所期望的那样。

这是我拥有的样式:

          <View
            sytle={{
                flexDirection: 'row',
                flex: 1,
                paddingLeft: 10,
            }}
          >
              { 
                this.props.team.map(
                    (v, i) => {
                        if(v.league.acronym === 'NFL'){
                            return(
                                <Check
                                    checked={ this.props.checkedLeagues.includes(v.league.acronym) ? this.state.checked[i] : false }
                                    index={i}
                                    value={v.team_name}
                                    changeCheck={this.changeCheck}
                                />
                            )
                        }

                    }
                )
             }
          </View>

0 个答案:

没有答案
相关问题