2
votes

I am new in Appcelerator framework, I have developed one application in appcelerator, but that application looks good on IOS but for android its not look good. I want to develop a screen which is responsive like html. Is there any way to design appcelerator screen like responsive screen.

Thanks you.

1

1 Answers

2
votes

Don't define width, unless calculated. iOS is fairly simple with only a handful different resolutions, on Android you never know what resolutions you might encounter.

Luckily, you can specify widths differently in Titanium than you can in HTML. For example

var view = Ti.UI.createView({
  left: 20,
  right: 20
});

This will make your view the width of the parent, with 20 padding right and left, the width will be calculated.

Also, always stick to native UI elements. So tabgroups, actionbar/navigationBar should all be used so you don't have to worry about cross platform support, styling and sizing of those elements.

Furthermore, most view should be put in ScrollView's when you don't know how tall the UI is going to be. It could fit on iOS, but not on a small Android device. Putting it in a scrollview will always fix the screen as the scrollview will automatically enable scrolling when the content is taller than what fits.

So conclusion

  • Width should be defined relative. Either with left/right properties, or calculated
  • If height of content is not yet known or not designed to be fullscreen wrap it in a scrollview
  • Stop thinking of apps as websites, start thinking of them as Apps. Layout works differently

Lastly, Appcelerator is the company, Titanium is the technology you're using :)