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

Android Responsive Design

$
0
0

I've been working on an android application on Titanium lately and i've come upon an issue.

What i'm struggling with is making a specific view responsive.

I want to show like 15-20 buttons on a view but i don't want it to be scrollable. Now if i use around 50dpi which is the recommended for buttons on some smaller screens i miss some of them.

How should i approach this? Should i use % of the device width and height which i get like

function PixelsToDPUnits(ThePixels) {
    if ( Titanium.Platform.displayCaps.dpi > 160 )
        return (ThePixels / (Titanium.Platform.displayCaps.dpi / 160));
    else 
        return ThePixels;
}
 
Ti.App.deviceWidth = PixelsToDPUnits(Ti.Platform.displayCaps.platformWidth);
Ti.App.deviceHeight = PixelsToDPUnits(Ti.Platform.displayCaps.platformHeight);
Should i create say 4-5 different views and load the right one according to the user's DPI?

What's the most correct way to approach this.

THanks


Viewing all articles
Browse latest Browse all 8068

Trending Articles



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