Igor Lipin
Igor Lipin

Reputation: 41

React native, how can i set font Size in pixels?

How can i set font Size in pixels?

Hello, Designer send me sizes of app components. Header must be 60 pixels , but if i put font size 60, it is very big. How can i adjust it for pixels. Thank you. (IOS DEVICE)

Upvotes: 2

Views: 7147

Answers (1)

Noitidart
Noitidart

Reputation: 37328

You cannot do pixels on mobile. You do DPI. Tell your designer to get with the tech. He's designing for web. While you can figure out how many DPI correlate to how many pixels for the current device (its a device specific thing) with the PixelRatio API - https://facebook.github.io/react-native/docs/pixelratio.html - it's putting in effort to make your design worse. DPI works great across different screens/sizes.

Upvotes: 2

Related Questions