Hi All,
I am implementing a facebook style menu in my application using the below example/
// Drawer Menu var leftMenu = Ti.UI.createWindow({ top : 0, left : 0, width : 302, touchEnabled : true }); Ti.include('ui/leftnav.js'); LeftNav.init(); leftMenu.add(LeftNav.view); leftMenu.open(); // left nav animations var animateLeft = Ti.UI.createAnimation({ left : 250, right : -250, curve : Ti.UI.ANIMATION_CURVE_EASE_OUT, duration : 500 }); var animateRight = Ti.UI.createAnimation({ left : 0, right : 0, curve : Ti.UI.ANIMATION_CURVE_EASE_OUT, duration : 500 }); // right nav animations var rightMenuAnimationRight = Ti.UI.createAnimation({ right : 500, left : -500, curve : Ti.UI.ANIMATION_CURVE_EASE_OUT, duration : 500 }); //overflow menu var rightMenu = Ti.UI.createWindow({ top : 0, ~~~ right : 0, width : 500, touchEnabled : true, zIndex : 10 }); Ti.include('ui/rightNav.js'); RightNav.init(); rightMenu.add(RightNav.view); rightMenu.open(); var winMain = Titanium.UI.createWindow({ translucent : false, barImage : 'none', barColor : '#e0595a', navTintColor : 'white', statusBarStyle : Titanium.UI.iPhone.StatusBar.OPAQUE_BLACK, backgroundColor : '#f4f4f4' }); Ti.include('ui/home.js'); Home.init(); winMain.add(Home.view); currentwin = winMain; var navWin = Titanium.UI.iOS.createNavigationWindow({ window : winMain }); currentNav = navWin; //leftNavButton var btnDrawer = Ti.UI.createImageView({ image : 'ui/images/drawer.png', left : 40, width : 35, height : 25, top : 25 }); winMain.leftNavButton = btnDrawer //rightNavButton var buttonObjects = [{ image : 'ui/images/messages.png', width : 30, height : 28 }, { systemButton : Titanium.UI.iPhone.SystemButton.FIXED_SPACE, width : 10 }, { image : 'ui/images/search.png', width : 24, height : 24 }, { systemButton : Titanium.UI.iPhone.SystemButton.FIXED_SPACE, width : 10 }, { image : 'ui/images/menuoverflow.png', width : 6, height : 20 }, { systemButton : Titanium.UI.iPhone.SystemButton.FIXED_SPACE, width : 10 }]; rightButtons = Ti.UI.createButtonBar({ labels : buttonObjects, backgroundColor : 'transparent', width : 'auto', height : 'auto' }); winMain.rightNavButton = rightButtons var isToggled = false; btnDrawer.addEventListener('click', function(e) { if (!isToggled) { winMain.animate(animateLeft); isToggled = true; } else { winMain.animate(animateRight); isToggled = false; } }); navWin.open();
Problem is click event are firing with the left and right menu controls. Working on this for 2 days. plesae help. I am using 3.2.2 GA SDK. Is it an issue with zIndex?
Thanks in advance
Regards
Geervani