Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Detecting the current graphics resoultion

  • Titanium 1.1.0
  • Android 1.6
  • HVGA/QVGA

Is there a way to detect the current graphics resolution? As in, HVGA is 320x480 where as QVGA is 240x320. I've been beating my head trying to figure out why a button isn't showing up where I think it should only to find out that QVGA is a smaller resolution than HVGA. Couple that with the fact that I was using QVGA as an oddity and never switched back to HVGA, and it has been a frustrating day.

I read a post that mentioned something about screen.x/screen.y, but I don't find anything like that in the API docs or KitchenSink (though I haven't fired up grep to look for likely patterns yet). If someone has an example or link that would be awesome.

Vadtec

— asked March 25th 2010 by Nicholas Davey
  • android
  • api
  • documentation
  • example
  • graphics
  • mode
  • resoultion
  • screen
  • titanium
0 Comments

1 Answer

  • Accepted Answer

    Ti.Platform.displayCaps will give you what you want. The "Platform Data" test in KitchenSink shows it in use.

    — answered March 25th 2010 by Don Thorp
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.