For my first post on Dev.to, I want to share my React Native project structure, configurations and some tips. It contains most of the things I've l...
For further actions, you may consider blocking this person and/or reporting abuse
How do I make ur react native app stable on different screen size
My react native app on my emulator is okay but when I test it on a smaller screen size the soon doesn't fit the screen
Hi. You are right, I don't know how I can forgot to talk about responsiveness. I will update that soon on my repository. Here are what I do to handle that:
normalize
function for adapting hard values accordingly to the screen's width or height. I might upload it on the repository later:So now I can use:
Hope this help :D
Hi Arthur, thanks for the article.
Just wanted to confirm, do we need the Math.round operation in normalize function? Since roundToNearestPixel returns a layout dimension and guarentees that it will be rendered to a non-fractional amount of pixels in the native side, I think we don't need to round once more. Also, what is the reason for 2dip difference in Android?
Thanks a lot.
I'd like to also ask as to how do you deal with system font sizes? Or is that something that should be considered while designing the app beforehand?
I use the function normalize() that I mentionned in the post so I don't have much problems with the font sizes.
Oh, so that's not just for the actual screen size of the phone, but also for font sizes? TIL
Well the function adapt a hard value like 13 depending on the screen sizes for exemple on the iPhone X the fontSize will be 13 but on the iPhone5, the fontSize is 11
Excellent post, trying to use TS on my next project too!
I am getting a 404 on the GitHub link
Ah yes I forgot to update it. Thank you. Here is the link github.com/NewBieBR/typescript-rea...
thanks :)