Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3205] Android: Null dimensions should be ignored or throw an exception

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-08-31T14:04:26.000+0000
Affected Version/sRelease 1.6.0
Fix Version/sn/a
ComponentsAndroid
Labelscore
ReporterDawson Toth
AssigneeNeeraj Gupta
Created2011-04-15T03:39:27.000+0000
Updated2017-03-27T18:20:50.000+0000

Description

Problem

If you create a view and set one of the dimensions (such as "right") to null, it will still influence the layout of the view.

Example

The expected behavior for the following would be a view that is 100px high and 100px width, left aligned. But when you set right: null, it will stretch across the entire view.

var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
win.add(Ti.UI.createLabel({
    text: 'Right null test', textAlign: 'center',
    left: 0, top: 0, width: 100, height: 100,
    backgroundColor: '#f00',
    right: null
}));
win.open();

Workaround

Don't include the dimension with null and it won't influence the layout.

Tested On

Titanium SDK version: 1.7.0 (02/18/11 18:13 316c2c7)
BROKEN on Android Device 2.1
WORKS on iPhone Simulator 4.2

Associated Helpdesk Ticket

http://developer.appcelerator.com/helpdesk/view/75421">http://developer.appcelerator.com/helpdesk/view/75421

Comments

  1. Junaid Younus 2012-08-31

    Tested on a Samsung Galaxy S2 using TiSDK 2.2.0v20120830102513, unable to reproduce the issue. Ticket marked as resolved.
  2. Lee Morris 2017-03-27

    Closing ticket as I am unable to reproduce this issue with the following environment; Pixel (7.1) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.3 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80

JSON Source