View Full Version : How to auto adjust the components for Sencha Touch 2 application in phones ad tabs

8 Aug 2013, 11:40 PM
Am creating a project using Sencha Architect in that you have the option to select a device to display your views. Devices include ipad, iphone 4 and 5, Blackberry etc etc. Am creating a project as per view in iphone (320 * 480 ). My question is when i view the project in ipad simulator the components of my view screen do not adjust automatically. I want to run my project on iphone,ipad,blackberry or any android phone or tab. How can i achieve this independence so that my components on screen could adjust length, height etc etc properties at their own. Is there any way to do this by using Sencha Architect ? below are my doubts..

(1)Each phone and tab also have different resolutions in that case how my components will auto fit according to size of the screen.
(2) If my step 1 requirement is possible can it be achieved using Sencha Architect ? if not Can you please suggest an IDE for Sencha like we use eclipse for java which gives us suggestions upon Ctrl+Space.
(3) If i go by profile way do i need to code separately for phones and tabs ?

10 Aug 2013, 6:32 PM
Instead of specifying lengths in px, use "em". That would help a little with adjusting screen sizes. Though, I'm not sure if there are such code editors or whatever in architect since i used it for one day about a year ago ;) If you wanted separate profiles, it would be some extra code too, but not much if you plan it all out ahead of time. You'd pretty much have a view for each profile, and the controllers/models/stores would stay the same. Or, you can condense the views and use lots of conditions. I don't see a downside to either option.

You can use the Eclipse for Java EE IDE if you want and get the plugin for Sencha. I just am used to referencing the docs if I need to know a certain method or property and use notepad++/Sencha Cmd :))

26 Aug 2013, 10:43 PM
Thanks jerome76, my requirement is fulfilled by using fit layout. and for coding the sencha application now am using notepad++ which is helpful and of-course the sencha touch docs are very helpful.