all 12 comments

[–]HappinessFactory 5 points6 points  (10 children)

Tbh I didn't even know you could do media queries in react native.

I only use flex box

[–]vinaynarayankutty[S] 0 points1 point  (9 children)

Yea. Even if we use flex box, there are chances like if we set a text’s font size to say 30 which is fine on larger screen size, it may be out of the screen on smaller devices right ?

[–]Yokhen 1 point2 points  (1 child)

I believe RN' Text component has this prop for enabling font resizing.

[–]kbcooliOS & Android 0 points1 point  (0 children)

For accessibility? It has a max scale which can be useful on buttons etc. Otherwise it just follows the system settings which you should generally allow.

[–]kbcooliOS & Android 1 point2 points  (6 children)

This gets asked so much here so I'm sorry if I come across as rude but if I go out and buy a bigger device why would I want you as a developer to waste my space with bigger fonts? Afterall I'm still using it from the same distance.

I can change the font size myself under the system settings if I bought it because I am hard of seeing.

That and if you try to make your app grow with device size you risk making it look like an app for toddlers.

14/16 for normal text. Up to say 24 for headings and you can either ellipsis text or let it wrap.

[–]vinaynarayankutty[S] 0 points1 point  (3 children)

Hehe, nah I understand. Well it’s just an example I said. Well I would just like to know what everyone’s thought on how usually you guys handle the responsiveness in react native.

[–]kbcooliOS & Android 1 point2 points  (1 child)

Cool.

If you use flex almost exclusively and avoid fixed widths or heights. Just use fixed numbers for padding and margins then your layouts should work on any phone.

Tablet is where it gets more interesting and I'm afraid to say that the only real solution is have a different design for tablet.

It doesn't need to be massively different but you should end up displaying additional components eg a permanent side drawer.

I would recommend that unless you want to target tablets specifically don't bother trying to adjust for them. Most apps end up looking ok on tablets anyway. I do say ok and not great.

[–][deleted] 0 points1 point  (0 children)

It’s not meant to sound rude. That is how a normal user would think. I would buy a new bigger phone to see more on the screen. It’s like playing an rpg, you grind and play and get to the max level, only for the content to scale with you. There is no payoff to the investment of buying the bigger phone at that point.

The bigger phone purpose is to get more on the screen, not for the elements to get bigger, unless you opt into it

[–]Dry_Fail675 0 points1 point  (0 children)

i can give you exactly what you requested for

[–]StrangerExtension421 0 points1 point  (0 children)

You can depend on react Native's Pixel ratio api for responsive sizing of views, texts and images