Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13777] BlackBerry - Setting left and right does not calculate the width. The same thing with top and bottom.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-08-07T15:45:47.000+0000
Affected Version/sRelease 3.1.1, Release 3.2.0
Fix Version/sRelease 3.1.1
ComponentsBlackBerry
Labelsmodule_layout, qe-testadded
ReporterPedro Enrique
AssigneeRussell McMahon
Created2013-05-07T15:20:55.000+0000
Updated2017-03-09T07:52:10.000+0000

Description

Take the following example. You should see a white margin around this red view. Instead you'll see that margin only on the top and left side of the view.
var win = Ti.UI.createWindow({
    backgroundColor: 'white'
});

var view = Ti.UI.createView({
	left: 10,
	right: 10,
	bottom: 10,
	top: 10,
	backgroundColor: 'red'
});

win.add(view);
win.open();

Attachments

FileDateSize
Screen Shot 2013-05-07 at 8.19.42 AM.png2013-05-07T15:20:55.000+000061189
Screen Shot 2013-05-07 at 8.20.42 AM.png2013-05-07T15:20:55.000+0000112158

Comments

  1. Russell McMahon 2013-05-25

    This should stay 3.1.1 as it's RC and we may spin another build next week
  2. Pedro Enrique 2013-05-29

    Functional test failed. Works on views who's default width and height are "FILL" but fails on views that who's width and height are "SIZE", Labels, for example, fail. This is supposed to create a label with a red background color and a 10 margin all around, instead, it is sized to fit its text and it's placed at the top 10 and left 10 of the screen:
       var win = Ti.UI.createWindow();
       var view = Ti.UI.createLabel({
           text: 'Hello World',
           backgroundColor: 'red',
           left: 10,
           right: 10,
           top: 10,
           bottom: 10
       });
       win.add(view);
       win.open();
       
  3. Russell McMahon 2013-05-30

    I'm still working on this one. It works for simple views but not controls that the os resizes. I think I'm close and should have it working this morning. Then will do a PR. It's not a regression so 3.1.1 could go out without, but it should get in as soon as possible.
  4. Ingo Muschenetz 2013-05-30

    I'm going to defer from 3.1.1 to 3.1.2. Trying to keep the list as short as possible.
  5. Lokesh Choudhary 2013-06-14

    Verified the fix & now setting left right & top & bottom works as expected as in parity with IOS as shown in the screenshot attached. Environment: Ti Studio : 3.1.1.201306112235 Ti BB SDK : 3.1.1.v20130613185544 Mac OSX : 10.8.3 Alloy : 1.1.3-cr CLI - 3.1.1-cr win 7 Win 8 Z10 BB simulator : 10.0.10.822 Z10 device running 10.0.10.88
  6. Lee Morris 2017-03-09

    Closing ticket as fixed.

JSON Source