O'Reilly logo

Appcelerator Titanium Smartphone App Development Cookbook - Second Edition by Jason Kneen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating your own Alloy widget

In the previous recipe, you added an existing widget to your application, but sometimes you might notice that part of the application you are creating could be made reusable. For example, you might have a calendar component, or a picker, or an interface that would be useful to make into a widget, so you can reuse it in other applications.

It's important, however, to understand that a widget should be self-contained. It shouldn't rely on any other part of your application to function. It shouldn't need other widgets to function correctly. You should be able to drop it into another project and it should just work. This is the fundamental test of whether a widget is fully reusable or not. If it relies on having styles, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required