Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-713] two tab groups, closing one causes crash

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:54:00.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.3.0
ComponentsiOS
Labelsn/a
ReporterNolan Wright
AssigneeBlain Hamon
Created2011-04-15T02:35:00.000+0000
Updated2011-04-17T01:54:00.000+0000

Description

from premium ticket

http://helpdesk.appcelerator.net/tickets/1758">http://helpdesk.appcelerator.net/tickets/1758

put this code in app.js

// this sets the background color of the master UIView (when there are no windows/tab groups on it) Titanium.UI.setBackgroundColor('#000');

// create tab group var tabGroup = Titanium.UI.createTabGroup();

// // create base UI tab and root window // var win1 = Titanium.UI.createWindow({

title:'Tab 1',
backgroundColor:'#fff'

}); var tab1 = Titanium.UI.createTab({

icon:'KS_nav_views.png',
title:'Tab 1',
window:win1

});

var showBtn = Titanium.UI.createButton({title:"Show tab group",width:200,height:50});
showBtn.addEventListener('click',function(){

showTabGroup2();

}); win1.add(showBtn);

// // add tabs // tabGroup.addTab(tab1);

// open tab group tabGroup.open();

// create and show second tab group var tabGroup2;

function buildTabGroup2() {

tabGroup2 = Titanium.UI.createTabGroup();
// window
var tg2Win = Ti.UI.createWindow({
    title:'TEST',
    top:0
}); 
var btn = Titanium.UI.createButton({title:"Hide tab group",height:50,width:200});
btn.addEventListener('click',function(){
    Ti.API.info('BOO ' + tabGroup2);
    tabGroup.close({transition:Ti.UI.iPhone.AnimationStyle.CURL_UP});

});
tg2Win.add(btn);

// tg2Win.hideTabBar();

var tab = Titanium.UI.createTab({
    title:'TEST',
    window:tg2Win
});
tabGroup2.addTab(tab);

} function showTabGroup2() {

if(!tabGroup2) buildTabGroup2();

tabGroup2.open({transition:Ti.UI.iPhone.AnimationStyle.CURL_DOWN});

}

Comments

  1. Jeff Haynie 2011-04-15

    (from [6efe824c0efe070d7187de23fe58468066c974c1]) Closes #713: Extraneous call to [self detatchView]. http://github.com/appcelerator/titanium_mobile/commit/6efe824c0efe070d7187de23fe58468066c974c1"> http://github.com/appcelerator/titanium_mobile/commit/6efe824c0efe0...

JSON Source