2

When I set allowFontScaling={false} for TextInput must be Text size don't be scaled.(It's right.)

but Placeholder size still be scaled (I think that it's unreasonable.).

how to set allowFontScaling={false} for TextInput's placeholder ???

my code:

<TextInput placeholder="my placeholder" allowFontScaling={false}/>
Mohammad Nazari
  • 2,535
  • 1
  • 18
  • 29
  • You can try styling it with css: https://css-tricks.com/almanac/selectors/p/placeholder/ – Chase DeAnda Feb 27 '18 at 22:42
  • "Add Text.defaultProps.allowFontScaling=false at the beginning of the app (e.g. main.js or app.js etc ...) to apply this prop on all Text components through out the whole app." https://stackoverflow.com/questions/41807843/how-to-disable-font-scaling-in-react-native-for-ios-app – Omar Feb 27 '18 at 22:44
  • @Omar - I added this but still have this problem – Mohammad Nazari Feb 28 '18 at 09:25
  • It is because because you must replace Text by TextInput (I guess) – MaieonBrix Apr 06 '18 at 05:43
  • You can also use the module [react-native-global-props](https://github.com/Ajackster/react-native-global-props) to set global default props to one particular set of component (use the setCustomTextInput function that this lib exports) – MaieonBrix Apr 09 '18 at 14:48

0 Answers0