在原生基础上更改占位符字体样式 [英] Change placeholder font style on native-base

查看:31
本文介绍了在原生基础上更改占位符字体样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用原生基础输入组件,并且我尝试自定义占位符字体样式类似于以下示例,但它不会更改占位符.它改变了用户键入的输入值的样式.如何更改占位符字体样式?

I use native base Input Component, and I tried to customize the placeholder font style like the following example, but it does not change the placeholder. It changed the style of the user typed input value. How can I change the placeholder font style?

<Input
  style={{color:"blue", fontFamily:"Arial"}}
  placeholder="I am blue and Arial font"
/>

更新

我已经像下面的例子一样尝试过 placeholderStyle,但它不起作用.

I already tried placeholderStyle like the following example, but it does not work.

<Input
  placeholderStyle={{color:"blue", fontFamily:"Arial"}}
  placeholder="I am blue and Arial font"
/>

推荐答案

文本输入和占位符的字体系列是相同的,但是我假设您的意思是占位符的颜色没有改变,这是解决方案.

The font family is the same for the text input and the placeholder, however I assume you meant that the color didn't change for the placeholder, here's the solution.

这样做:

<Input
  style={{color:"blue", fontFamily:"Arial"}}
  placeholderTextColor="blue"
  placeholder="I am blue and Arial font"
/>

这篇关于在原生基础上更改占位符字体样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆