如何使用jfeinstein10 / SlidingMenu实现两个层面slidingmenu在Android中? [英] How to implement two level slidingmenu in Android using jfeinstein10 / SlidingMenu?

查看:151
本文介绍了如何使用jfeinstein10 / SlidingMenu实现两个层面slidingmenu在Android中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建2级android的滑动菜单。当我点击第一个滑动菜单项  我需要在左侧显示它的另一个滑动菜单。我创建了第一级使用以下code滑动菜单。

I want to create 2 level sliding menu in android. When i click on the first sliding menu item i need to show another sliding menu on the left to it. I created the first level sliding menu using the following code.

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/menu_frame"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ListView    
        android:id="@android:id/list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingLeft="@dimen/list_padding"
        android:paddingRight="@dimen/list_padding" />

</FrameLayout> 

code部分

Code Part

SlidingMenu menu;
menu = new SlidingMenu(this);
menu.setMode(SlidingMenu.LEFT);
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
menu.setShadowWidth(10);
menu.setFadeDegree(0.0f);
menu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW);
menu.setBehindWidth(200);
menu.setMenu(R.layout.menu_frame);

如何着手进行第二级滑动菜单?

How to proceed to make the 2nd level sliding menu?

推荐答案

我们可以使用在Android上TranslateAnimation实现SlideMenu。在XML中创建的FrameLayout和具有MainXML页,然后MainSlidingMenu。邻近MainSlidingMenu有二次slidingMenu。默认情况下有MainSlidingMenu和辅助SlidingMenu无形。如果按钮点击或任何所需的事件happend显示主SlidingMenu,这时如果有一个点击/事件在MainSlidingmenu翻译MainMenu的进一步成显示辅助滑动菜单

We can achieve the SlideMenu using the TranslateAnimation in android. Create a frameLayout in XML and have MainXML page and then MainSlidingMenu. Adjacent to the MainSlidingMenu have the secondary slidingMenu. By default have the MainSlidingMenu and Secondary SlidingMenu invisible. If the button click or any required event happend show the Main SlidingMenu , then if there is a click/event in the MainSlidingmenu translate the MainMenu further to show the secondary sliding menu.

这篇关于如何使用jfeinstein10 / SlidingMenu实现两个层面slidingmenu在Android中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆