Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-484] Add support for block (or whatever you want to call it) layout

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:53:14.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.1.0
ComponentsiOS
Labelsn/a
ReporterNolan Wright
AssigneeBlain Hamon
Created2011-04-15T02:30:04.000+0000
Updated2011-04-17T01:53:14.000+0000

Description

We need to support a simple top-down layout for our native containers (windows, views, etc.)

This involves two major changes:

1) containers must support a layout property. We will initially only support a block layout (i.e., items added to a container will be stacked based on their explicit height or calculated height (for height:'auto')

2) views (all views) must support margin, marginTop, marginLeft, marginBottom, marginRight and padding, paddingTop, paddingLeft, paddingBottom, and paddingRight

Comments

  1. Nolan Wright 2011-04-15

    Reviewed your doc and talked it over with Jeff. The reality is that 90% of the cases only require vertical layout, so let's start simple.

    On the parent view let's add the ability to support a layout property. For now, this property will support two values: absolute and vertical. Absolute is the default.

    By default views will be added directly below the previously added view (i.e., no space between the views). Sub views can use their top, left, right and bottom properties to effectively specify relative positioning (acts like margin). So if the second sub view added specifies a top:10, we would place that view 10 pixels below the view above it.

  2. Blain Hamon 2011-04-15

    Verifying behavior: MarginFoo is the same as foo in absolute layout? (IE, it's the space outside the view owning the property. Padding would be the space inside the view?

  3. hal 2011-04-15

    Nolan

    Do I understand correctly that relative positioning is currently only available for windows, meaning that only their direct children flow vertically?

    Is there any plan to facilitate multiple views being relatively positioned within a container view and, if so, do you have any idea how long until it is released?

    This functionality, along with percentages used for width, height, left, right, top, bottom etc, will vastly simplify screen building for different sized target device. Note that percentages currently do not work - are you also aware of this?

    Thank you very much
    Hal

JSON Source