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 8593491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:00:03+00:00 2026-06-12T00:00:03+00:00

So following the concept here: http://docs.appcelerator.com/titanium/2.1/index.html#!/guide/Using_density-specific_resources_on_Android i created a folder that was Resources/android/images/ and

  • 0

So following the concept here:

http://docs.appcelerator.com/titanium/2.1/index.html#!/guide/Using_density-specific_resources_on_Android

i created a folder that was

Resources/android/images/

and then under that is:

high/
medium/
low/

and within each of those are the different-density files (like about.png, say)

The problem is that when i reference them:

var aboutTab = Ti.UI.createTab({
    icon: '/images/about.png',
    title: 'about',
    window: about
});

OR as others have suggested like so (that is, losing the leading slash on ‘images’):

var aboutTab = Ti.UI.createTab({
    icon: 'images/about.png',
    title: 'about',
    window: about
});

and then load up the app, sure the tabs themselves are there… but the icons are not. Note that if i have a plain old file present at:

Resources/images/about.png

then the icon will appear… but not otherwise. Is there… is there something i’m missing on this?

  • 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-06-12T00:00:05+00:00Added an answer on June 12, 2026 at 12:00 am

    Ok, so the standard answer never ended up working for me. I’m using Titanium 2.1 here. {insert insult about Ti developer heritage here}

    The solution to this is simple – don’t use the much vaunted “smart titanium density specific solution” as discussed here:

    http://docs.appcelerator.com/titanium/2.1/index.html#!/guide/Using_density-specific_resources_on_Android

    Instead, use this simple, homely code to fix your problems!

    var density =  (Titanium.Platform.displayCaps.dpi <= 160) ? 'low' : (Titanium.Platform.displayCaps.dpi > 160 && Titanium.Platform.displayCaps.dpi < 240) ? 'medium' : 'high'; 
    var preamble = (Ti.Platform.osname === 'iphone' || (Ti.Platform.osname === 'ipad') )? 'images':'android/images/'+density + '/';
    

    Ok, so the first bit sets the density – NOTE i do not know the proper density readings for Ti just now, i’m just putting this up until i work them out anyhoo – and the second bit uses it if the app is an android one.

    Then, where i used to have:

    var aboutTab = Ti.UI.createTab({
        icon: 'images/about.png',
        title: 'about',
        window: about
    });
    

    i now have:

    var aboutTab = Ti.UI.createTab({
        icon: preamble + '/about.png',
        title: 'about',
        window: about
    });
    

    And that is that!

    FINAL WORD:
    i’ve noticed that this can behave very differently depending on the Titanium version used (2.1.3 vs 2.1.0) or the android sdk used. I’ve had best results with 2.1.0 and 4.2 android, and that includes using the ‘images’ prefix (you know, how the guides say to do it).

    One thing i noticed was that I cannot have both the high/medium/low folders AND the hdpi folders, i need one or the other.

    Another problem i faced was that sometimes the code wouldn’t load the android/images/ folders across. The completely bullet-proof way to do this is to use the code i’ve described, but put the density-specific folders directly under your images folder, and refer to them via images/high/ etc. Content in images is always copied across, and the code shown always works, regardless of Ti version.

    Final note, make sure that your images are case-sensitively named, because it will work in the windows emulator but not in actual (unix-based) device.

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

Sidebar

Related Questions

Following chunk html code works as expected: <iframe src=http://www.amazon.com/></iframe> But when trying embed inner
here i have the following html, as it is basically match the following concept,
I'm using the following to define root while in development: define('LOCAL_URL', 'http://localhost/~xampp/Mysite'); define('REMOTE_URL', 'http://example.com');
Following is the Play 2 app, https://github.com/playframework/Play20/tree/master/samples/java/forms Which portrays Dynamic form binding where form
Still a bit new to the concept of M-V-VM in WPF, here's my problem:
I have tried following some tutorials and I get the concept of how the
I have tried to run the following code, as a proof of concept, and
Hi all i have a problem in understanding the concept of retain in following
Following the concept of CQRS (Command Query Responsibility Segregation), I am directly referring the
Iam bit new to SpringMVC REST concept. Need a help from experts here to

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.