react-native - can I make the array containing 5 names display Vertically Using the stylesheet in react native??
问题描述
render() {
var myloop = [
"Karan " + "\n",
"bharat " + "\n",
"parth " + "\n",
"dharmil " + "\n",
"raj "
];
return(
<Text>{myloop}</Text>
)
I know i can display it by using \n concatenation but i want to do it using stylesheet
解决方案
这可能对您有所帮助:
var myloop = [
"Karan ",
"bharat",
"parth",
"dharmil",
"raj"
];
return (
<View style={{ width: '100%', height: '100%' }}>
<View>
{
myloop.map((value, index) => {
return <Text>{value}</Text>
})
}
</View>
</View>
)
推荐阅读
- docker - 如何将 jupyter 添加到摇杆图像?
- .net-core - 如何在 Office 365 上创建实用的共享邮箱
- ios - swiftEntryKit 自定义弹出笔尖不加载数据
- spring - 当更新员工表时,为什么在地址表中插入新行。我也想要简单的更新地址表
- python - 无法使用不同的代理来执行后续请求
- daterangepicker - Daterangepicker 按周选择日期
- angular - 用于 GET 请求的 Angular 数据表的服务器端 Ajax 配置
- java - Firestore google.cloud.Timestamp 解析
- javascript - Google Chrome 将 XHR 调用的状态显示为 (blocked:other)
- java - 如何使用多个变量执行 MyBatis 查询