Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3045] Pinning a Label to one side with no sizes defined generates a warning in 2.0.1

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2012-05-29T17:03:13.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsios, iphone, studio
ReporterDavid Knell
AssigneeMauro Parra-Miranda
Created2012-04-18T14:13:46.000+0000
Updated2016-03-08T07:48:05.000+0000

Description

I have read the entire Transitioning to the New UI Layout System, particularly the section about Auto Sizes in iOS. From what I understand Labels with undefined sizes will use Ti.UI.SIZE, which makes sense. Now, if I try to pin that label to the left side of it's parent, I get [WARN] [object TiUILabel] has an auto height value of 0, meaning this view may not be visible.. I tried setting height:Ti.UI.SIZE to no avail. The document says "In most cases, simply leaving the width and height undefined should give reasonable default behavior for all view types, which was not always true in previous releases.". I know I can implicitly set height:30 but in previous releases height:'auto' worked great and the new height:Ti.UI.SIZE is giving the warning. The label looks exactly as I would expect with height:Ti.UI.SIZE OR with the height not defined at all, but I just get that warning. It seems like Titanium should only throw that warning if height:'auto' and there is not content in the view (or in this case, the Label). Code to reproduce:
 
var parentView = Ti.UI.createView({
    backgroundColor:'red',
    height:44,
    width:320
});
 
var testLabel = Ti.UI.createLabel({
    backgroundColor:'yellow',
    text:'This is a test...',
    left:10
});
parentView.add(testLabel);
win.add(parentView);

Comments

  1. Mauro Parra-Miranda 2013-11-24

    DUP issue.

JSON Source