一个导航抽屉里面的片段刷卡标签 [英] Swiping Tabs inside a Navigation Drawer Fragment

查看:106
本文介绍了一个导航抽屉里面的片段刷卡标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了导航抽屉通过参照本教程现在我想要做的是显示一个片段内刷卡标签。 IE浏览器。当我点击导航抽屉里的项目,可以说是第一个,它应该显示刷卡选项卡的项目。

I have implemented Navigation Drawer by Referring this tutorial and now what I want to do is to display swiping tabs inside a fragment. ie. when i click on an item in navigation drawer, lets say the first one, it should display swiping tabs for that items.

如果该ITEM1的活动,当我点击它,那么它应该显示刷卡标签与标签像今天的活动,以及即将发生的事件。我是个初学者,我试图谷歌这一点,解决方案,我发现是使用大侦探,但我不希望使用任何库。请点我一个正确的教程。我可以实现片段里面查看传呼机。鉴于这一观点寻呼机将有两个片段。

If the item1 is Events, when i click on it, then it should display swiping tabs with tabs like todays events, and upcoming events. Im a beginner and I have tried to google for this, the solution i find is using sherlock, but i dont want to use any library. Please point me to a right tutorial. Can i implement view pager inside fragment. Given that view pager will have two more fragments.

感谢你。

推荐答案

下面的抽屉,我是说在注释的一个例子。如果您有抽屉的布局和孩子的ListView和viewpager,这是布局将是什么样子:

Here's one example of the drawer I was talking in that comment. If you have the drawer layout and the child as listview and viewpager, this is how the layout will look like:

<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"
    android:background="#333333"
    tools:context=".MainActivity" >

    <android.support.v4.view.ViewPager
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/pager"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <!-- This List View for the sliding menu -->

    <LinearLayout
        android:id="@+id/list_slidermenu"
        android:layout_width="240dp"
        android:layout_height="wrap_content"
        android:layout_gravity="start"
        android:orientation="vertical" >
<!-- If you want to add some more things to your navigation drawer -->
        <!-- <EditText
            android:id="@+id/search_edit_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#FFFFFF"
            android:hint="Search"
            android:maxLines="1" >
        </EditText> -->

        <ListView
            android:id="@+id/list_slidermenu_child"
            android:layout_width="250dp"
            android:layout_height="match_parent"
            android:background="#303030"
            android:choiceMode="singleChoice"
            android:divider="#272727"
            android:dividerHeight="3dp"
            android:listSelector="@drawable/list_selector"
            android:padding="5dp" />
    </LinearLayout>

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

这是你的布局将是什么样子:

And this is how your layout will look like:

现在,在我的例子,当我点击列表中的任何项目,有观点寻呼机集,查看它应该是。

Now, in my example, When I click on any item in the list, the view pager sets that view it's supposed to be.

这是你希望它是什么?

Is this how you want it to be ?

下面是一个新的形象:

和上点击任何的导航项目,它显示就认为内容的后面?

And on click of any of the items in the navigation, it displays that content on the view behind it ?

这篇关于一个导航抽屉里面的片段刷卡标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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