Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-12434

Android: T.UI.FILL not used correctly with 'horizontal' layout

    Details

      Description

      In this example with an horizontal layout, Ti.UI.FILL is not used correctly.

      I have tried to look at the TiCompositeLayout, but I couldn't really find my way in it.

      This works, you will see the text of the label:

      var win = Titanium.UI.createWindow();
      win.backgroundColor = '#ccc';
       
      var view1 = Ti.UI.createView({
      	width : 400,
      	backgroundColor : 'red',
      	height : 40
       
      })
       
      var view2 = Ti.UI.createView({
      	width : 100,
      	backgroundColor : 'green',
      	left : 0
      })
      var view3 = Ti.UI.createLabel({
      	width : Ti.UI.FILL,
      	textAlign : 'right',
      	text : 'TestLayout',
      	backgroundColor : 'blue',
      	left : 100
      })
       
      view1.add(view2);
      view1.add(view3);
      win.add(view1);
      win.open();
      

      Now with the horizontal layout it doesn't work:

      var win = Titanium.UI.createWindow();
      win.backgroundColor = '#ccc';
       
      var view1 = Ti.UI.createView({
      	width : 400,
      	backgroundColor : 'red',
      	layout : 'horizontal',
      	horizontalWrap : false,
      	height : 40
       
      })
       
      var view2 = Ti.UI.createView({
      	width : 100,
      	backgroundColor : 'green',
      	left : 0
      })
      var view3 = Ti.UI.createLabel({
      	width : Ti.UI.FILL,
      	textAlign : 'right',
      	text : 'TestLayout',
      	backgroundColor : 'blue',
      	left : 0
      })
       
      view1.add(view2);
      view1.add(view3);
      win.add(view1);
      win.open();
      

        Attachments

          Activity

            People

            • Assignee:
              shameerj Shameer Jan
              Reporter:
              farfromrefuge Martin Guillon (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-15433
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code