如何添加滑动菜单上activtity这在Android的延伸tabactivity [英] how to add sliding menu to on the activtity which extend tabactivity in android

查看:255
本文介绍了如何添加滑动菜单上activtity这在Android的延伸tabactivity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何滑动菜单添加到其延伸标签活动未在滑动菜单和活动添加的活性

How to add sliding menu to the activity which are not added in the sliding menu and on activity which extends tab Activity

任何帮助将AP preciated。
在此先感谢

Any help will be appreciated. Thanks in advance

推荐答案

主要XML改变你这样的事情。(之前做到这一点,你的项目 - 右键点击> Android的工具 - >添加支持库,做好这项工作两次 - )

change you main xml to something like this.(before do this,right click on your project->android tools->add support library-do this work twice-)

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#000" >

    <!-- you main xml,all of your xml -->
</RelativeLayout>

<ScrollView
    android:layout_width="240dp"
    android:layout_height="match_parent"
    android:layout_gravity="start" >

    <RelativeLayout
        android:layout_width="300dp"
        android:layout_height="wrap_content"
        tools:context=".Tab_login" >

        <Button
            android:id="@+id/button2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/button3"
            android:layout_alignRight="@+id/button3"
            android:layout_below="@+id/button3"
            android:layout_marginTop="21dp"
            android:text="Register" />

        <Button
            android:id="@+id/button3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:text="Log In" />

        <Button
            android:id="@+id/Button02"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/button2"
            android:layout_alignRight="@+id/button2"
            android:layout_below="@+id/button2"
            android:layout_marginTop="19dp"
            android:text="free User" />

        <Button
            android:id="@+id/Button01"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/Button02"
            android:layout_alignRight="@+id/Button02"
            android:layout_below="@+id/Button02"
            android:layout_marginTop="23dp"
            android:text="Roaming" />
    </RelativeLayout>
</ScrollView>

</android.support.v4.widget.DrawerLayout>  

结果PIC:结果

THE RESULT PIC:

这篇关于如何添加滑动菜单上activtity这在Android的延伸tabactivity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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