4

The following fills the entire screen:

<View height="Ti.UI.FILL" width="Ti.UI.FILL">...</View>

The fill property is describe here: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI-property-FILL

However you can also do the same thing using:

<View height="100%" width="100%">...</View>

Therefore my question is, what's the difference?

Yahya Uddin
  • 26,997
  • 35
  • 140
  • 231

1 Answers1

6

Official guide says: "The Ti.UI.FILL behavior represents growing a view to fill its parent's dimensions. Note that the FILL behavior doesn't take into consideration other sibling elements in the parent." http://docs.appcelerator.com/platform/latest/#!/guide/Layouts,_Positioning,_and_the_View_Hierarchy

For sure Ti.UI.FILL is a Titanium constant you can use everywhere as is, while 100% is a string. I always prefer the first one. There could be a difference when we put two elements in the same container giving to one FILL and the other one a fixed size, or giving 100% to the first one and a fixed size to the other one, but usually when I use a view which should fill a space it's the only one in the container so I've never noticed any difference.

Mauro Piccotti
  • 1,807
  • 2
  • 23
  • 34