Problem
Since 3.1.2.GA i'm unable to add item to the actionbar on a tabGroup.
I've joined code to reproduce.
This code work with 3.1.1.GA.
Test case
var self = Ti.UI.createTabGroup({
fullscreen : true,
title : 'Action Bar'
});
//create app tabs
var win1 = Ti.UI.createWindow({
title : 'win1'
});
var tab1 = Ti.UI.createTab({
title : 'tab1',
window : win1
});
var win2 = Ti.UI.createWindow({
title : 'win1'
});
var tab2 = Ti.UI.createTab({
title : 'tab2',
window : win2
});
self.addTab(tab1);
self.addTab(tab2);
self.open();
tab1.window.addEventListener('focus', function(){
tab1.window.activity.onCreateOptionsMenu = function(e) {
var menu = e.menu;
var aboutMenuItem = menu.add({
title : "About",
showAsAction : Ti.Android.SHOW_AS_ACTION_IF_ROOM
});
aboutMenuItem.addEventListener("click", function(e) {
alert("About Item Clicked!");
});
var settingsMenuItem = menu.add({
title : "Settings",
showAsAction : Ti.Android.SHOW_AS_ACTION_IF_ROOM
});
settingsMenuItem.addEventListener("click", function(e) {
alert("Settings Item Clicked!");
});
};
});
<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
<id>com.test.actionbar</id>
<name>ActionBarSampleTi</name>
<version>1.0</version>
<publisher>_</publisher>
<url>http://</url>
<description>not specified</description>
<copyright>_</copyright>
<icon>appicon.png</icon>
<persistent-wifi>false</persistent-wifi>
<prerendered-icon>false</prerendered-icon>
<statusbar-style>default</statusbar-style>
<statusbar-hidden>false</statusbar-hidden>
<fullscreen>false</fullscreen>
<navbar-hidden>false</navbar-hidden>
<analytics>false</analytics>
<guid>99a04c4e-689f-4a4c-9870-a0843d7f21c0</guid>
<property name="ti.ui.defaultunit" type="string">system</property>
<iphone>
<orientations device="iphone">
<orientation>Ti.UI.PORTRAIT</orientation>
</orientations>
<orientations device="ipad">
<orientation>Ti.UI.PORTRAIT</orientation>
<orientation>Ti.UI.UPSIDE_PORTRAIT</orientation>
<orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
<orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
</orientations>
</iphone>
<android xmlns:android="http://schemas.android.com/apk/res/android">
<tool-api-level>16</tool-api-level>
<manifest>
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="11"/>
</manifest>
</android>
<modules/>
<deployment-targets>
<target device="tizen">false</target>
<target device="blackberry">false</target>
<target device="android">true</target>
<target device="ipad">false</target>
<target device="iphone">false</target>
<target device="mobileweb">false</target>
</deployment-targets>
<sdk-version>3.1.3.GA</sdk-version>
<property name="ti.deploytype">test</property>
</ti:app>
Hello Rémi Burtin, PLease check my following code for Actionbar in TabGroup.
My test Environment follows:
Ti SDK 3.1.3.GA Android SDK 4.0.0Test Code
Thanks
Closing this ticket as we have not been able to reproduce this issue. Please let us know if the issue persists with 3.2.0 GA release and we would be happy to reopen the ticket and investigate it further.