Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9181] Ti API: UI composite specification update

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-06-15T14:27:44.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sRelease 2.1.0, Sprint 2012-12 Core
ComponentsTiAPI
Labelscore
ReporterIvan Skugor
AssigneeMax Stepanov
Created2012-05-18T05:41:39.000+0000
Updated2012-06-22T13:14:49.000+0000

Description

Related to TIMOB-8121, when parent view has dimension value set to SIZE and child view has FILL, the way that views will size themselves is undefined/unspecified. It seems that all platforms have some behavior defined. Because of that, this case should be specified so that all platform implement same behavior. Currently, Mobile web in that situation looks for parent view that has dimension defined and size itself according to the size of that parent (it FILLs parent). IMHO, more intuitive behavior would be if parent would SIZE itself according to child size (if there is a child with fixed dimension value). For example: Window ParentView (SIZE) ChildView (FILL) View (50px) My suggestion is that ParentView should have 50px (and ChildView also), while Mobile web solution would size ChildView to size of Window (and ParentView also). It seems to me that parent elements should have priority in cases like this.
var Window = Ti.UI.createWindow({ fullscreen: true, backgroundColor: 'white'});
 
var ParentView = Ti.UI.createView({backgroundColor:'red',layout:'horizontal', width: Ti.UI.SIZE, height:300})
 
var ChildView =Ti.UI.createView({backgroundColor:'green',layout:'horizontal', height:200, width: Ti.UI.FILL });
var View =Ti.UI.createView({backgroundColor:'blue',height:120, width:50 });
var View2 =Ti.UI.createView({backgroundColor:'yellow',height:120, width:50 });

ChildView.add(View);
ChildView.add(View2);
ParentView.add(ChildView);
Window.add(ParentView);
Window.open();

Attachments

FileDateSize
Android vs. iOS.jpg2012-06-15T11:27:19.000+000062030
MobileWeb.jpg2012-06-15T11:40:55.000+000022236

Comments

  1. Max Stepanov 2012-06-15

    iOS and MobileWeb have a correct layout for default horizontal wrap=true mode. Android should be fixed.
  2. Max Stepanov 2012-06-15

    Now we have consistent horizontal behavior across all platforms. Android needs a fix for vertical positioning which is filed as TIMOB-9575
  3. Arthur Evans 2012-06-22

    Has anything been done with this issue? The comments above appear to be related to TIMOB-9575, not to the parent SIZE, child FILL conflict described in this bug.
  4. Bryan Hughes 2012-06-22

    Must have missed these comments the first time around. Arthur is correct, this ticket has nothing to do with horizontal layouts. This is as much a documentation issue as anything. We need to formally declare what the behavior is in a SIZE/FILL conflict.

JSON Source