Reputation: 325
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:
what should i change in the config to display properly? Thanks
Upvotes: 0
Views: 175
Reputation: 5332
Add the following in your tiApp.xml file
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<supports-screens android:anyDensity="false"/>
</manifest>
</android>
This will basically scales them according to the android devices in use, since android devices are coming in different resolutions. Please refer Defaults For Android Layouts. I used it and found it working with different resolution even for tablets also
Upvotes: 0
Reputation: 2270
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'
};
Upvotes: 2