Titanium Community Questions & Answer Archive

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

Transform app to universal app? (works both in iPhone/iPod Touch and iPad)

There's a way to transform my app to universal app?

This is to modify my application and make it work both on the iPhone/iPod touch and iPad, running natively on ipad with your screen proportion, etc..

PS: I know all iPhone app works on iPad, but works on iPhone's proportion, 320x480.

— asked April 10th 2010 by Marcos Gonçalves
  • ipad
  • iphone
  • universal
0 Comments

1 Answer

  • Accepted Answer

    You could try using Titanium.Platform.DisplayCaps and check for the platformWidth or platformHeight to see what screen dimensions you are on, then act accordingly.

    see: https://developer.appcelerator.com/apidoc/mobile/1.2/Titanium.Platform.DisplayCaps

    Or you could use just Titanium.Platform.model to see what type of device your app is on. [ https://developer.appcelerator.com/apidoc/mobile/1.2/Titanium.Platform ]

    Another thing to think about when sizing things is to use the left and right properties, instead of setting a width. That way you could easily alter view/label sizes for any screen and in any orientation.

    — answered April 10th 2010 by Kosso
    permalink
    1 Comment
    • If you have created a new project and specified as a Deployment Target only iPhone but not iPad, converting that to universal (both iPad & iPhone) later takes a couple steps.

      The way to add iPad as a deployment target, is to open up tiapp.xml in TiApp editor and check the box for iPad in the deployment targets section.

      Then it will still be displayed within the iPhone app player - when run on the iPad, until you also add Default-Landscape.png and Default-Portrait.png to Resources/iphone.

      One you do that - it will display not in the iPhone app player box - but as a regular iPad app.

      Of course at that point you still need to code for the iPad - and following Kosso's advice to do that coding is then appropriate.

      — commented September 4th 2013 by Robert Dupuy
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.