[AC-2154] Mobile Web: Titanium.UI.TabGroup.close() doesn't close the tab group
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Closed |
| Resolution | Invalid |
| Resolution Date | 2013-01-28T15:33:16.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Titanium SDK & CLI |
| Labels | n/a |
| Reporter | Yaroslav Pidstryhach |
| Assignee | Davide Cassenti |
| Created | 2013-01-15T08:05:51.000+0000 |
| Updated | 2016-03-08T07:41:08.000+0000 |
Description
Function [Titanium.UI.TabGroup.close()](http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.TabGroup-method-close) doesn't close the tab group and doesn't remove it from the UI.
Example:
var wind = Titanium.UI.createWindow();
var tabGroup = Titanium.UI.createTabGroup();
var redWin = Titanium.UI.createWindow({ backgroundColor: "red"});
var baseUITab = Ti.UI.createTab({
title: 'base_ui_title',
window: redWin
});
tabGroup.addTab(baseUITab);
wind.add(tabGroup);
wind.addEventListener('postlayout', function (){
tabGroup.close(); // does nothing
});
wind.open();
Hello, You are never calling the tabGroup.open() method, so the tab group won't be closed; if you do something like this, everything will work:
var tabGroup = Titanium.UI.createTabGroup(); var redWin = Titanium.UI.createWindow({ backgroundColor: "red"}); var baseUITab = Ti.UI.createTab({ title: 'base_ui_title', window: redWin }); tabGroup.addTab(baseUITab); tabGroup.addEventListener('postlayout', function (){ tabGroup.close(); // now it works }); tabGroup.open();You are right, thank you.