yomybaby/kr.yostudio.drawer

IOS Support?

Closed this issue · 2 comments

Hi all ,

previously I am used com.tripvi.drawerlayout module for android through titanium.
I want use com.tripvi.drawerlayout module for IOS through titanium.

To Support com.tripvi.drawerlayout module for IOS , I have installed kr.yostudio.drawer module in through titanium.Now I able to add the com.tripvi.drawerlayout module to my app.But when I am running my app I am getting below error:

[ERROR] :  Module com.tripvi.drawerlayout version 1.2.0 is missing library file: /Users/srinivas/Library/Application Support/Titanium/modules/iphone/com.tripvi.drawerlayout/1.2.0/libcom.tripvi.drawerlayout.a

can any help me out how to resolve it?

index.js

var TiDrawerIndex = require('com.tripvi.drawerlayout');
$.index.open();

System requirements:

Node.JS: 0.10.13
Titanium CLI: 3.4.1
Node.Acs: 10.0.21
Alloy: 1.5.1
Titanium Studio: 3.4.1.2014
Titanium Sdk version: 3.5.0 GA
Ios Sdk: 8.1
Mac Os X: 10.9.5 64bit os

Thanks, you made 1st issue. 😄

On Android, this works as a wrapper of com.tripvi.drawerlayout.
On iOS, this works like drawer using scallableView. (See this LeftDrawer)
You should use kr.yostudio.drawer widget instead of com.tripvi.drawerlayout module.
Additionally, this is a Alloy widget. Why don't you user alloy view(xml)?

Check this xml : https://github.com/yomybaby/kr.yostudio.drawer/blob/master/app/views/index.xml

If you don't use NavButton and Menu, you can like this :

<Alloy>
    <Widget src="kr.yostudio.drawer" 
        onDraweropen="onDrawerOpen" 
        onDrawerclose="onDrawerClose">
        <View class="menuWrap" role="leftView">
            <Require id="menuC" src="menu">
            </Require>
        </View>
        <Window role="centerWindow" title="yo.drawer widget">
            <Require src="main" id="mainC">
            </Require>
        </Window>

    </Widget>
</Alloy>

If you want to use on controller(js file)? Use like below:

var drawerLayout = Alloy.createWidget('kr.yostudio.drawer');

var centerWin = Ti.UI.createWindow({
    role: 'centerWindow',
    backgroundColor : 'gray'
});
var btn = Ti.UI.createButton({title:'Toggle Menu!'});
btn.addEventListener('click',function(){
    drawerLayout.toggleLeftView();
});

centerWin.add(btn);
drawerLayout.add(centerWin);

var leftView = Ti.UI.createView({
    role : 'leftView',
    backgroundColor: '#ff3976'
});
leftView.add(Ti.UI.createLabel({text:'LEFT !!'}));
drawerLayout.add(leftView);

drawerLayout.open();