【发布时间】:2017-07-14 17:22:38
【问题描述】:
我想在我的文本周围加上一个边框。
<View style={{ borderRadius: 1, borderWidth: 1, borderColor:'#FF0000',}}>
<Text style={{
fontSize: 0.8,
fontWeight: '400',
layoutOrigin: [0.5, 0.5],
paddingLeft: 0.2,
paddingRight: 0.2,
textAlign: 'center',
textAlignVertical: 'center',
transform: [{translate: [0, 0, -3]}],
}}>
hello
</Text>
</View>
如果我将borderWidth 保留为1,我会看到hello 但我看不到边框。如果我将borderWidth 更改为10 之类的东西,我什么也看不到。如何为 hello 文本添加边框?
【问题讨论】:
-
你能创建一个 jsFiddle 吗?
-
我不知道如何把它放在 jsFiddle 但这里是 git 链接 github.com/lunzhang/react-vr-tetris 。您只需将 src/index.vr.js 中的代码替换为我发布的代码
-
遗憾的是,没有办法将 React VR 代码嵌入到任何流行的 Playground(codepen、jsbin 等)中,有人应该在 Github 上向开发人员报告这个问题 :)