Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Implementing alloy widget drawer menu

$
0
0

I'm trying to implement youtube style slider menu in my app using Titanium Alloy. Should support both iOS and Android. After some search, I found alloy widget drawer menu, mcongrove slider and ds slider. Which one is the best among these ? I tried implementing the 1st on listed, and I was able to get it working if I'm creating the views in the js file only; ie, not using the alloy markups. If I'm creating view inside alloy and passing that reference, it's not working. I added the slider menu widget under widgets folder and created the menu controller. Then in my xml file,

<Require type="widget" src="com.alcoapps.drawermenu" id="drawermenu"/>
<View id="wrapper">
</View>
And initialized it in my js file,
var menu=Alloy.createController('menu').getView();
menu.addEventListener('click',function(e){
    $.drawermenu.showhidemenu();    
});
 
//var main=Ti.UI.createView({backgroundColor: "#cacaca"});
var main = $.wrapper;
 
$.drawermenu.init({
    menuview:menu,
    mainview:main,
    duration:200,
    parent: $.win
});
This code is not working. If I'm removing the view markup from xml file and creating it in the js file, it works fine. What should be wrong here ? Or Is this not the way it's supposed to work ? Please help.

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>