Set*_*Lar 1 reactjs react-native native-base
我使用本机基本输入组件,我尝试自定义占位符字体样式,如下例所示,但它不会更改占位符.它改变了用户输入值的样式.如何更改占位符字体样式?
<Input
style={{color:"blue", fontFamily:"Arial"}}
placeholder="I am blue and Arial font"
/>
Run Code Online (Sandbox Code Playgroud)
更新
我已经尝试placeholderStyle过以下示例,但它不起作用.
<Input
placeholderStyle={{color:"blue", fontFamily:"Arial"}}
placeholder="I am blue and Arial font"
/>
Run Code Online (Sandbox Code Playgroud)
字体系列对于文本输入和占位符是相同的,但是我假设你的意思是占位符的颜色没有变化,这是解决方案.
做这个:
<Input
style={{color:"blue", fontFamily:"Arial"}}
placeholderTextColor="blue"
placeholder="I am blue and Arial font"
/>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3431 次 |
| 最近记录: |