Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Is it correct to use Ti.Platform.displayCaps.logicalDensityFactor for pixels- dp convertion ?

$
0
0

In order to avoid this problem, i had to set a main View in my app in fixed height value instead of its previous relative value in percentage. For this reason i wrote this formula when creating that main View:

height:loginScrnHeigh/Ti.Platform.displayCaps.logicalDensityFactor
loginScrnHeigh is gotten by making some percentage Cross-multiplication (i won't show this calculation here) to determine what should be that value if (9.375 % --- === --> 65 pixels) so (81.25 % --- === --> ??? = loginScrnHeigh).. and the factor logicalDensityFactor was 1,5. i have met also another problem when setting the main height value which is that, by the docuementation : "View height, in platform-specific units." so normally it's not an obligation to put 'px' when setting the value but it wasn't the same result when adding it or not.

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>