[TIMOB-11483] iOS: UICompositeLayout - Postlayout event is not fired on a window inside a tab
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-12-10T17:57:22.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Release 3.0.0, Release 3.1.0, 2012 Sprint 21 API, 2012 Sprint 21 |
Components | iOS |
Labels | api, qe-ios100112, qe-testadded, regression |
Reporter | Anshu Mittal |
Assignee | Vishal Duggal |
Created | 2012-10-15T07:16:29.000+0000 |
Updated | 2015-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
File | Date | Size |
---|---|---|
UICompositeLayout.zip | 2012-12-10T11:08:06.000+0000 | 7819360 |
PR for master https://github.com/appcelerator/titanium_mobile/pull/3238 PR for 3_0_X https://github.com/appcelerator/titanium_mobile/pull/3240
CR &FR
Tested with: SDK:3.0.0.v20121019153308 Studio: 3.0.0.201210141844 Device: LG-p970(Android 2.2.2) Postlayout events are fired successfully.
Tested with: SDK:3.0.0.v20121019153308 Studio: 3.0.0.201210141844 Device: iPhone 3GS(v 5.0.1) Postlayout events are fired successfully.
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
Tested this with all sims supported. Do not have a device to test right now. Will test and verify on device before resolving.
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
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.
Closing as fixed. Tested on: Titanium Studio, build: 3.0.0.201211301903 Titanium SDK, build: 3.0.0.v20121207120202 Device: iPad 2 (5.1)