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

Windows: Wrong layout with bottom/right and center

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Release 7.1.0
    • Fix Version/s: Release 7.5.0
    • Component/s: Windows
    • Labels:
      None
    • Story Points:
      8
    • Sprint:
      2018 Sprint 15 SDK, 2016 Sprint 17 SDK, 2018 Sprint 18 SDK, 2018 Sprint 19 SDK, 2018 Sprint 20 SDK

      Description

      bottom property is not calculated property when it is used with center property.

      var view1 = Ti.UI.createView({
          width: 400, height: 400,
          backgroundColor: 'white'
      }),
      view2 = Ti.UI.createView({
          backgroundColor: 'blue',
          center: {
              x: 200,
              y: 200
          },
          width: 100, bottom: 100
      }),
      view3 = Ti.UI.createView({
          backgroundColor: 'red',
          width: Ti.UI.FILL, height: 1, bottom: 100
      });
      var win = Ti.UI.createWindow({
          backgroundColor: 'green'
      });
      view1.add(view2);
      view1.add(view3);
      win.add(view1);
      win.open();
      

      Actual: The blue box (view2) and ed line (view3) are not aligned

      Expected: The blue box (view2) should be aligned with red line (view3).

      More test cases:

      var view = Ti.UI.createView({
          height: 200,
          width: 200,
          backgroundColor: 'gray'
      }),
          viewChild = Ti.UI.createView({
              backgroundColor: 'blue',
              center: {
                  x: 100
              },
              right: 50
          }),
          line = Ti.UI.createView({
              backgroundColor: 'red',
              width: 1, height: Ti.UI.FILL,
              right: 50, top: 0
          });
      var win = Ti.UI.createWindow();
      viewChild.addEventListener('postlayout', function () {
          Ti.API.info(viewChild.size.width + ' should eql(100)');
      });
      view.add(viewChild);
      view.add(line);
      win.add(view);
      win.open();
      

      var view = Ti.UI.createView({
          height: 200,
          width: 200,
          backgroundColor: 'gray'
      }),
          viewChild = Ti.UI.createView({
              backgroundColor: 'blue',
              center: {
                  y: 100
              },
              bottom: 50
          }),
          line = Ti.UI.createView({
              backgroundColor: 'red',
              width: Ti.UI.FILL, height: 1,
              bottom: 50, left: 0
          });
      var win = Ti.UI.createWindow();
      viewChild.addEventListener('postlayout', function () {
          Ti.API.info(viewChild.size.width + ' should eql(200)');
      });
      view.add(viewChild);
      view.add(line);
      win.add(view);
      win.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kiguchi Kota Iguchi
                Reporter:
                kiguchi Kota Iguchi
                Reviewer:
                Gary Mathews
                Tester:
                Keerthi Mahalingam (Inactive)
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code