gio*_*ozh 1 textinput react-native react-native-textinput
我有一个带有圆角的 TextInput :
<TextInput
style={{
backgroundColor : '#FFFFFF',
borderRadius : 30,
marginLeft : 8,
marginRight : 8,
marginTop : 10
}}
placeholder = 'A placeholder'
/>
Run Code Online (Sandbox Code Playgroud)
但我想为占位符(以及将包含在 TextInput 中的文本)提供一些左侧填充,因为现在文本太靠近左侧 TextInput 边框。我该怎么做?
使用 paddingLeft 代替 marginLeft
<TextInput
style={{
backgroundColor: '#ffffff',
borderRadius: 30,
paddingLeft: 8,
paddingRight: 8,
marginTop: 10
}}
placeholder='A placeholder'
/>
Run Code Online (Sandbox Code Playgroud)
我希望这个能帮上忙
| 归档时间: |
|
| 查看次数: |
8664 次 |
| 最近记录: |