Yes, didn't find anything similar
It seems that NativeScript is not consistent on transform px to dpi in Android. marginTop allocate views on different position according the device the app is running on. Please see GIF attached to see the problem.
Everything is correctly shown on left device. The red views are precisely allocated below the line of reference. But on right device you can see red views are misallocated, having a gap between the reference line and where the view lyes down. The later the red view is pinned, the biggest the gap is.
Not sure which UI is wrong, either the line of references (height=40) or the red views, as far as I understand this issue, one of them is not being precisely transformed to dpi. I checked that the core view round up the margin top lp.topMargin = Math.round(params.topMargin * utils.layout.getDisplayDensity());
but even I tried without it round up, the issue is still there.
Only in Android. iOS work perfectly across different devices
This issue is part of a bigger app, so I just isolated the issue on a demo app. Demo app can be found here. To replicate it, just run demo app in two different Android devices. In GIF attached, I used Google Nexus 4 - 5.1.0 API 22 - 768x1280 320dpi (left device where it works well) and Google Nexus 7 - 5.1.0 800x1280, 213dpi (right device where it works wrongly. See the gaps below the line the view should be allocated)
Please, check demo app por this issue.
https://github.com/OscarLopezArnaiz/androidResolutionIssue
Thanks
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Hey @OscarLopezArnaiz thank you for reporting this one - I can confirm that I am reproducing this case at my side!
Probably related to https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/core/view.android.ts#L607-L610
Code to reproduce here (issue visible with testing on Nexus 7)
@hshristov
The issue still reproduces with {N} 3.0.0 RC.
Hey guys,
Any update on this?
Most helpful comment
Hey @OscarLopezArnaiz thank you for reporting this one - I can confirm that I am reproducing this case at my side!
Probably related to https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/core/view.android.ts#L607-L610
Code to reproduce here (issue visible with testing on Nexus 7)
@hshristov