Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11941] iOS: When showing a view, we should first relayout

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-06T18:24:00.000+0000
Affected Version/sRelease 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterMartin Guillon
AssigneeEric Merriman
Created2012-10-19T14:48:21.000+0000
Updated2017-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();

Comments

  1. Martin Guillon 2012-10-19

    pull request https://github.com/appcelerator/titanium_mobile/pull/3297
  2. jithinpv 2013-03-26

    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
  3. Ingo Muschenetz 2014-04-07

    PR is dead, so deferring for now.
  4. Lee Morris 2017-06-06

    Closing with reference to Ingo's comment.

JSON Source