Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11483] iOS: UICompositeLayout - Postlayout event is not fired on a window inside a tab

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-12-10T17:57:22.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.0, Release 3.1.0, 2012 Sprint 21 API, 2012 Sprint 21
ComponentsiOS
Labelsapi, qe-ios100112, qe-testadded, regression
ReporterAnshu Mittal
AssigneeVishal Duggal
Created2012-10-15T07:16:29.000+0000
Updated2015-01-27T21:56:51.000+0000

Description

Postlayout event is not fired in a window inside a tab. This is regression since the issue does not occur in 2.1.3 GA. Steps to reproduce: 1. Create an app using the code below. 2. Launch the app. Expected: The text on the label should get printed on the screen i.e. " Green view.center.x should be 50 and is: 50 ' Green view.center.y should be 50 and is: 50" Actual: The label text is not printed.
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'white'
});

var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win1
});

var label = Ti.UI.createLabel({
	text: 'View Size is: ',
	top: 100,
	left: 10,
	height: Ti.UI.SIZE,
	width: Ti.UI.SIZE,
	color: 'black'
});
var view = Ti.UI.createView({
	backgroundColor: 'green',
	height: 40,
	width: 40,
	center: {x:50,y:50}
});

win1.addEventListener('postlayout', function (e) {
	//win.removeEventListener('postlayout', layoutHandler);
	label.text = 'Green view.center.x should be 50 and is: '+view.center.x+'\nGreen view.center.y should be 50 and is: '+view.center.y;
	//win.addEventListener('postlayout', layoutHandler);
});

win1.add(label);
win1.add(view);

tabGroup.addTab(tab1); 
tabGroup.open();

Attachments

FileDateSize
UICompositeLayout.zip2012-12-10T11:08:06.000+00007819360

Comments

  1. Vishal Duggal 2012-10-15

    PR for master https://github.com/appcelerator/titanium_mobile/pull/3238 PR for 3_0_X https://github.com/appcelerator/titanium_mobile/pull/3240
  2. Sabil Rahim 2012-10-17

    CR &FR
  3. Anshu Mittal 2012-10-24

    Tested with: SDK:3.0.0.v20121019153308 Studio: 3.0.0.201210141844 Device: LG-p970(Android 2.2.2) Postlayout events are fired successfully.
  4. Anshu Mittal 2012-10-24

    Tested with: SDK:3.0.0.v20121019153308 Studio: 3.0.0.201210141844 Device: iPhone 3GS(v 5.0.1) Postlayout events are fired successfully.
  5. Anshu Mittal 2012-12-08

    Tested with: SDK: 3.0.0.v20121207120202 Studio: 3.0.0.201211301903 Device: Iphone4s(v 5.1), iPad3(v 6.0) Postlayout event is not fired on a window inside a tab. The issue does not occur on 2.1.4 GA
  6. Vishal Duggal 2012-12-09

    Tested this with all sims supported. Do not have a device to test right now. Will test and verify on device before resolving.
  7. Anshu Mittal 2012-12-10

    When we create a standalone app with the code mentioned above, it works fine. However we tested it with the project attached which has the same code is failing to fire the postlayout event. Steps: 1. Install the attached project. 2. Go to acceptance tab. Click on 1020_ViewCenter Expected: The following should be displayed: "Green view.center.x should be 50 and is: 50 Green view.center.y should be 50 and is: 50" Actual: The above message is not displayed. The above project works fine on 2.1.4GA but not on 3.0
  8. Vishal Duggal 2012-12-10

  9. Vishal Duggal 2012-12-10

    The issue was reopened due to postlayout event not firing in the windows own context which has already been reported in QE-303 and resolved as invalid.
  10. Tamila Smolich 2012-12-10

    Closing as fixed. Tested on: Titanium Studio, build: 3.0.0.201211301903 Titanium SDK, build: 3.0.0.v20121207120202 Device: iPad 2 (5.1)

JSON Source