[TIMOB-11941] iOS: When showing a view, we should first relayout
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-06-06T18:24:00.000+0000 |
Affected Version/s | Release 3.1.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Martin Guillon |
Assignee | Eric Merriman |
Created | 2012-10-19T14:48:21.000+0000 |
Updated | 2017-06-06T18:24:00.000+0000 |
Description
*Problem description*
If you run the testcase, when pushing the button, the red view will appear and you will see it of width 50 before going quickly to 200. Actually you expect it to be directly 200 when you show it as you set the property before calling "show." So the view should force itself to relayout before becoming visible. It comes from the method willShow of TiViewProxy.
*Pull request*
See comment.
*Test case*
var win = Ti.UI.createWindow({backgroundColor:'white'});
var label = Ti.UI.createLabel({
height:50,
width:50,
top:2,
backgroundColor:'red',
visible:false
});
win.add(label);
var b1 = Ti.UI.createButton({
title:'ADD CHILD',
bottom:10,
height:35
});
b1.addEventListener('click',function(){
label.width = 200;
label.show();
});
win.add(b1);
win.open();
pull request https://github.com/appcelerator/titanium_mobile/pull/3297
Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) iOS iPhone Simulator: iOS SDK version: 6.0
PR is dead, so deferring for now.
Closing with reference to Ingo's comment.