Units (dp and px) #5690
Closed
CyberCyclone
started this conversation in
General
Replies: 2 comments
-
Hi! I think units in Native Base are calculated on a base four.
I found this information here in the spacing file 👍 : https://github.com/GeekyAnts/NativeBase/blob/master/src/theme/base/space.ts |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks @EricSoeun. That's perfect 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to understand how the units work. I have a Box that has a width defined as
80
(no units defined). When I do an inspection on my iPad of the component it says the width is 320.When I use
PixelRatio.get()
it comes back as 2. If the units NativeBase uses aredp
(independent pixels), shouldn't it be rendered as 160 (80 * 2) in literal pixels? How does it calculate it to be 320, which is 4 times 80?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions