What object types can you add to a view (Ti.UI.createView)?

You must Login before you can answer or comment on any questions.

It seems to me that Views (Ti.UI.createView) in Titanium are very limited compared to Windows (Ti.UI.createWindow) when it comes to object types it can contain or am I wrong? I understand that you can add labels, buttons, images, text areas and text fields but can you add another view like a TableView or a WebView to it? Can it display another(external) .js file(‘url’)? Is there anyone that can give me some code examples of how to add these objects to a view(Ti.UI.createView)?

1 Answer

Accepted Answer

Sure -- you can put pretty much any view subclass inside of a basic view. The biggest restriction I can think of is that you want to avoid putting views that manage their own scrolling inside other views that manage their own scrolling (e.g. a WebView inside a ScrollView is a bad idea).

There are tons of examples of views inside views in the KitchenSink demo (I'm so glad it's been refactored now so I can recommend it).

Download it here and import it into Ti Studio. One particular example is in ui/common/baseui/scroll_views_many.js.

— answered 10 months ago by Jason Priebe
answer permalink
1 Comment
  • Even without the kitchensink, it is quite easy to test what you want to do and you learn more that way!

    — commented 10 months ago by Kami -

Your Answer

Think you can help? Login to answer this question!