[AC-1757] Unable to add item to the actionbar with tabGroup
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2014-01-06T00:09:44.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | Android, actionbar |
Reporter | Rémi Burtin |
Assignee | Ritu Agrawal |
Created | 2013-10-01T15:27:44.000+0000 |
Updated | 2016-03-08T07:40:38.000+0000 |
Description
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>
Attachments
File | Date | Size |
---|---|---|
app.js | 2013-10-01T15:27:44.000+0000 | 954 |
Screenshot 2013-12-24 11.48.59.png | 2013-12-24T07:09:53.000+0000 | 28204 |
tiapp.xml | 2013-10-01T15:27:44.000+0000 | 1900 |