React native 数组项后的特征线

React native 数组项后的特征线,react-native,React Native,我有一个数组中的项目。我想在设置第一项后更改行,依此类推。我得到的是一行中的值。但我想把它写在专栏里。我的价值在于: 015245088 9823178404 9851108404 015245088 9823178404 9823178404 但我想要的价值是: 015245088 9823178404 9851108404 015245088 9823178404 9823178404 我已实施以下措施: this.state = {

我有一个数组中的项目。我想在设置第一项后更改行,依此类推。我得到的是一行中的值。但我想把它写在专栏里。我的价值在于:

015245088    9823178404  9851108404
015245088    
9823178404  
9823178404  
但我想要的价值是:

015245088    9823178404  9851108404
015245088    
9823178404  
9823178404  
我已实施以下措施:

 this.state = {
        contact: [
            {
                id: 0,
                name: '015245088'
            },
            {
                id: 1,
                name: '9823178404'
            },
            {
                id: 2,
                name: '9851108404'
            }
        ]
      }

<CardSection>
   <FontAwesomeIcon style={styles.contentStyle} icon={faPhone} />
      {
         this.state.contact.map((item, index) => (
           <TouchableOpacity
              key={item.id}
              style={styles.opacityStyle}
              onPress={()=>Linking.openURL(`tel:${item.name}`)}>                               

              <Text style={styles.contactStyle}>{item.name} </Text>

          </TouchableOpacity>
         ))
        }
     </CardSection>
this.state={
联系人:[
{
id:0,
名称:“015245088”
},
{
id:1,
名称:“9823178404”
},
{
id:2,
名称:“9851108404”
}
]
}
{
this.state.contact.map((项目,索引)=>(
Linking.openURL(`tel:${item.name}`)}>
{item.name}
))
}
此状态={
联系人:[
{
id:0,
名称:“015245088”
},
{
id:1,
名称:“9823178404”
},
{
id:2,
名称:“9851108404”
}
]
}
{
this.state.contact.map((项目,索引)=>(
Linking.openURL(`tel:${item.name}`)}>
{item.name}
}
此状态={
联系人:[
{
id:0,
名称:“015245088”
},
{
id:1,
名称:“9823178404”
},
{
id:2,
名称:“9851108404”
}
]
}
{
this.state.contact.map((项目,索引)=>(
Linking.openURL(`tel:${item.name}`)}>
{item.name}
}

您需要将
flexDirection
更改为
。 因此,只需将以下样式添加到
style.contentStyle
。或者将
map
函数包装为
View
,然后将以下样式添加到其中

flexDirection: 'column'
flex: 1

您需要将
flexDirection
更改为
。 因此,只需将以下样式添加到
style.contentStyle
。或者将
map
函数包装为
View
,然后将以下样式添加到其中

flexDirection: 'column'
flex: 1

您是否正在使用Faltlist或任何映射函数?您是否可以共享更多代码?您是否在某处应用了
flexDirection:“行”
样式?默认显示应为列而不是行。您只需在容器组件中的某处设置
flexDirection:“列”
样式,它应该可以在以下文档中工作-。检查以snack为例-您是否使用Faltlist或任何映射函数?您是否可以共享更多代码?您是否在某个位置应用了
flexDirection:“行”
样式?默认显示应该是列而不是行。您只需在容器组件中的某个位置设置
flexDirection:“列”
样式,就可以了是文档-。请查看此示例-使用
柔性方向
是不正确的。样式值需要使用驼峰大小写。使用
柔性方向
是不正确的。样式值需要使用驼峰大小写。