Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Proper nesting of views with respect to positioning

I noticed that the UI module docs indicate a center property which is relative to the parent view.

Specifically: Ti.UI.ImageView

>center object a dictionary with properties x and y to indicate the center of the views position relative to the parent view

However, when I nest an image view inside another view which is positioned inside my "main" view for a window, this property seems to only respect the "root" view:

snippet of setup:

var dashboardView = Ti.UI.createView({


var consoleView = Ti.UI.createView({

var forceImage = Ti.UI.createImageView({


I expect the forceImage to appear at the horizontal center and vertical top of the 110px high consoleView which is situated at the bottom of the dashboardView. Instead, forceImage appears horizontally centered with it's vertical center at the top of the window (the top half is cut off by the status bar).

If my understanding of the view hierarchy or positioning properties is incorrect please explain it's proper use. This is causing me great headache in implementing a flexible layout.

— asked March 15th 2010 by Robert Carlsen
  • center
  • layout
  • mobile
  • position

0 Answers

The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.