Search code examples
androidconfigurationappcelerator-mobile

titanium android configuration OSX


I am new at this, and I am following the tut from "Appcelerator Titanium Smartphone App Development Cookbook"

Now I have built pretty much the all app, but when I try to build in android I get a very awkward result. see pics:

enter image description here enter image description here enter image description here

what should i change in the config to display properly? Thanks


Solution

  • There is nothing to change in configuration. You need to provide different resources for different device resolutions (as retina and non-retina pics for iPhone there are also different resolutions and sizes for android). Take a look at User Interface Fundamentals of Titanium docs.Additionally you should use always 'dp' (device-independent pixel) for all sizes (height, width, top, left, etc.). Then Titanium recalculates this sizes for the current device.

    Ti.UI.createView({
      height: '20 dp',
      width: '20 dp',
      left: '20 dp'
    };