在本机基础上更改占位符字体样式
Change placeholder font style on native-base
我使用原生基础Input Component,我尝试像下面的例子一样自定义占位符字体样式,但它并没有改变占位符。它改变了用户键入的输入值的样式。如何更改占位符字体样式?
<Input
style={{color:"blue", fontFamily:"Arial"}}
placeholder="I am blue and Arial font"
/>
更新
我已经试过 placeholderStyle
像下面的例子,但它不起作用。
<Input
placeholderStyle={{color:"blue", fontFamily:"Arial"}}
placeholder="I am blue and Arial font"
/>
文本输入和占位符的字体系列相同,但我假设您的意思是占位符的颜色没有改变,这是解决方案。
这样做:
<Input
style={{color:"blue", fontFamily:"Arial"}}
placeholderTextColor="blue"
placeholder="I am blue and Arial font"
/>
我使用原生基础Input Component,我尝试像下面的例子一样自定义占位符字体样式,但它并没有改变占位符。它改变了用户键入的输入值的样式。如何更改占位符字体样式?
<Input
style={{color:"blue", fontFamily:"Arial"}}
placeholder="I am blue and Arial font"
/>
更新
我已经试过 placeholderStyle
像下面的例子,但它不起作用。
<Input
placeholderStyle={{color:"blue", fontFamily:"Arial"}}
placeholder="I am blue and Arial font"
/>
文本输入和占位符的字体系列相同,但我假设您的意思是占位符的颜色没有改变,这是解决方案。
这样做:
<Input
style={{color:"blue", fontFamily:"Arial"}}
placeholderTextColor="blue"
placeholder="I am blue and Arial font"
/>