React native 如何在React Native中同时跨行和列?
问题React native 如何在React Native中同时跨行和列?,react-native,flexbox,React Native,Flexbox,问题 如何利用flexbox使文本同时占用行和列?我希望在正方形的左上角、右上角和左下角填充文本 灵活方向列/行示例: return <View style={[ {flex:1 , flexDirection: 'column' // also tried row} ]}> <Text style={[ flex:1, flexWrap: 'wrap
如何利用flexbox使文本同时占用行和列?我希望在正方形的左上角、右上角和左下角填充文本 灵活方向列/行示例:
return <View style={[
{flex:1 , flexDirection: 'column' // also tried row}
]}>
<Text style={[
flex:1,
flexWrap: 'wrap',
overflow: "visible",
]}>
This is some text that I want to wrap right and then drop to the next row.
</Text>
<View style={
{
justifyContent: 'flex-end',
alignSelf: 'flex-end',
width: '25%',
height: '25%',
},
}>
</View>
</View>
}
return <Text style={[
flex:1,
flexWrap: 'wrap',
overflow: "visible",
]}>
This is some text that I want to wrap right and then drop to the next row.
</Text>
<View style={
{
justifyContent: 'flex-end',
alignSelf: 'flex-end',
width: '25%',
height: '25%',
},
}>
</View>
}
返回
这是一些文本,我想包装的权利,然后下降到下一行。
}
结果问题: 如果我将弹性方向放在行中,文本将仅跨越列,反之亦然,弹性方向为列。如何跨越此项目周围的文本
对齐示例:
return <View style={[
{flex:1 , flexDirection: 'column' // also tried row}
]}>
<Text style={[
flex:1,
flexWrap: 'wrap',
overflow: "visible",
]}>
This is some text that I want to wrap right and then drop to the next row.
</Text>
<View style={
{
justifyContent: 'flex-end',
alignSelf: 'flex-end',
width: '25%',
height: '25%',
},
}>
</View>
</View>
}
return <Text style={[
flex:1,
flexWrap: 'wrap',
overflow: "visible",
]}>
This is some text that I want to wrap right and then drop to the next row.
</Text>
<View style={
{
justifyContent: 'flex-end',
alignSelf: 'flex-end',
width: '25%',
height: '25%',
},
}>
</View>
}
返回
这是一些文本,我想包装的权利,然后下降到下一行。
}
结果问题
文本仍然没有换行到下一行或下一列。您确定项目正在生成吗?您编写这些示例的方式存在一些错误,有时react native仅在控制台中显示这些类型的错误,运行的是旧版本的应用程序。@Auticcat这些只是示例片段,通过复制粘贴出现错误。但是是的,项目构建没有问题。您确定项目正在构建吗?您编写这些示例的方式存在一些错误,有时react native仅在控制台中显示这些类型的错误,运行的是旧版本的应用程序。@Auticcat这些只是示例片段,通过复制粘贴出现错误。但是,是的,项目构建没有任何问题。