gpt4 book ai didi

react-native - 在不使用库的情况下在 native react 中使用文本行

转载 作者:行者123 更新时间:2023-12-04 22:55:45 24 4
gpt4 key购买 nike

试图复制以下设计但无法复制。将不胜感激。

enter image description here

我最后尝试的代码如下,但该行覆盖了文本。

<View>
<View style={{ alignSelf:'center', borderBottomColor:'black', borderBottomWidth:1,height:'50%', width:'90%' }}/>
<Text style={{ alignSelf:'center', paddingHorizontal:5 }}>Your class</Text>
</View>

最佳答案

让它以这种方式工作:

<View style={{flexDirection: 'row'}}>
<View style={{backgroundColor: 'black', height: 2, flex: 1, alignSelf: 'center'}} />
<Text style={{ alignSelf:'center', paddingHorizontal:5, fontSize: 24 }}>Your class</Text>
<View style={{backgroundColor: 'black', height: 2, flex: 1, alignSelf: 'center'}} />
</View>

enter image description here

关于react-native - 在不使用库的情况下在 native react 中使用文本行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47862821/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com