Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6746999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:23:21+00:00 2026-05-26T12:23:21+00:00

Simple question, which is the best way to make sure that the app works

  • 0

Simple question, which is the best way to make sure that the app works on different screen resolutions without looking crap? I can’t use static values, then it want adjust according to the resolution. Right now i am using relative measurements (percentage of screen) but wonder if that’s really the best way to handle it!?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:23:22+00:00Added an answer on May 26, 2026 at 12:23 pm

    Another/additional option we have been successful with is a small set of functions which use the screen density value to compute display sizes… this is of course only an approximation, as there are only the four densities, but we have found this to be very helpful.

    //=============================================================================
    // inch
    //
    // compute approximate number of pixels for the specified physical on-screen
    // size based on the density reported by the OS
    //=============================================================================
    function inch(size)
    {
        // default to 160 dpi if unavailable
        var height = size * 160.0; 
    
        try
        { 
            // compute header height based on screen density ... target .25" height
            height = size * Ti.Platform.displayCaps.dpi; 
        }
        catch(e) { warn("Error accessing display caps for screen density calculation: " + e); }
    
        return height;
    }
    

    So if you want something to be 3/4 inch high on the screen….

    Ti.UI.createThing({ height: inch(.75)});
    

    …or if you want to scale things by point size, one could make some constants…

    const g_12pt = inch(12/72); //0.166667
    const g_10pt = inch(10/72); //0.138889
    const g_8pt = inch(8/72);   //0.111111
    const g_6pt = inch(6/72);   //0.083333
    ...
    ...font:{fontSize: g_10pt, fontWeight:"bold"},...
    

    We also created a couple of functions to get the screen height and width, so if we wanted a better layout on a tablet or something tiny we could better understand what we were dealing with.

    //=============================================================================
    // screenWidth - return screen width in inches
    //=============================================================================
    function screenWidth()
    {
        return Titanium.Platform.displayCaps.platformWidth / Titanium.Platform.displayCaps.dpi;
    }
    
    //=============================================================================
    // screenHeight - return screen height in inches
    //=============================================================================
    function screenHeight()
    {
        return Titanium.Platform.displayCaps.platformHeight / Titanium.Platform.displayCaps.dpi;
    }
    

    You can go on and on from there… but this really helped us nail down how we laid out our screens on the different densities and platforms. The inch function has exception handling only because we use it early in the app, and sometimes the Ti.Platform is still undefined. By the time we are laying out our reports Ti.Platform is available and so the screen functions do not have the exception handling. If you need to query earlier you may need exception handling in those as well.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a simple question which makes it painfully obvious that I need to
Simple question which I can't seem to find an answer of: I have two
I have a pretty simple question which perhaps someone familiar with Server/Client design &
got a very simple question which I can't seem to find any answer for.
A fairly simple question for which I have a guess, but I can't find
It is a simple question to which I am not able to find the
I have a very simple question for which I can't seem to find an
simple question... Given I have an ASP.NET site, which uses a [custom] RoleProvider, Is
A simple question. I have an ASP.NET web application which contains several assemblies and
A simple question, how would I go about declaring a clause which would produce

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.