[TIMOB-7574] MobileWeb: Label does not resize appropriately with height 'auto'
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2012-02-16T18:02:43.000+0000 |
| Affected Version/s | Release 2.0.0 |
| Fix Version/s | Sprint 2012-04, Release 2.0.0 |
| Components | MobileWeb |
| Labels | qe-port, stage2 |
| Reporter | Patrick Seda |
| Assignee | Bryan Hughes |
| Created | 2012-02-07T17:29:45.000+0000 |
| Updated | 2012-08-27T15:04:44.000+0000 |
Description
When using a height value of 'auto', a Label does not resize its height.
To reproduce, run the following code in MobileWeb. The attached screen captures show the inconsistent behavior between iOS and MobileWeb.
var win = Ti.UI.createWindow();
var label = Ti.UI.createLabel({
text : 'Appcelerator gets your team up and running on Titanium with a full range of training and certification programs: in-classroom, on-demand, or on-site at your location.',
width : 150,
height : 'auto',
top : 50,
left : 50,
backgroundColor : '#ddd'
});
win.add(label);
win.open();
Attachments
| File | Date | Size |
|---|---|---|
| app.js | 2012-02-15T16:51:34.000+0000 | 497 |
| labelAutoHeight_iOS.tiff | 2012-02-07T17:29:45.000+0000 | 35296 |
| labelAutoHeight_mobileWeb.tiff | 2012-02-07T17:29:45.000+0000 | 12038 |
| Screen Shot 2012-02-09 at 3.35.43 PM.png | 2012-02-09T15:38:06.000+0000 | 31290 |
Also related, I noticed that even if the label gets ellisisized, the height of the label grows. See pic attached.
var win = Titanium.UI.createWindow({ backgroundColor:'#fff', layout: 'vertical' }); win.add(Titanium.UI.createLabel({ text:"A really long line of text that will surely get cut off, but notice how the it gets an ellipsis and yet the height is about the same as if it was wrapping", backgroundColor: "#9A0707", border: 1, color: "#fff", font:{fontSize:14,fontFamily:'Helvetica Neue'}, textAlign:'left', left:5, right: 5, top: 5, height:'auto' })); win.open();It turns out that these two issues are unrelated, so I am focusing on Patrick's issue. I think that Chris' issue has been fixed (or rather sidestepped) due to other changes. Patrick: The fix I implemented is not complete, unfortunately. To properly fix it will require TIMOB-7463 and possibly TIMOB-7079, but I am going ahead with the pull request so that we can get the other fixes in sooner rather than later. Pull Request: https://github.com/appcelerator/titanium_mobile/pull/1409
Re-opening so we can keep track of the remaining issue.
Pull Request: https://github.com/appcelerator/titanium_mobile/pull/1452 (Same as TIMOB-7463).
Verified fix on: Titanium studio : 2.1.1.201207271312 SDK version : 2.2.0.v20120824175712 Chrome 21.0.xx Firefox 14.0.1 Safari 6.0 Android 2.3.6 default browser Iphone 5.0.1 mobile safari