向上滑动面板与景观寻呼机标题地带 [英] Slide Up Panel with View Pager Title Strip

查看:158
本文介绍了向上滑动面板与景观寻呼机标题地带的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用这我向上滑动面板。每一件事情是工作的罚款用一个简单的布局。
现在的问题是,我怎么可以插入在面板寻呼机标题条,这样我可以让我的寻呼机查看它正在与多个片段。

I am using this LIBRARY for my slide up panel. every thing is working fine with a simple layout. Now my question is , how can I insert a pager title strip in that panel so that I can make it my View pager working on it with multiple fragments.

第一个图像标题带底部
二是向上滑动滑动片段

First image is title strip at bottom second is slide up and sliding fragments

推荐答案

从您的previous后,我假设你使用这个库(的 https://github.com/umano/AndroidSlidingUpPanel )。

From your previous post, I'm assuming you're using this library (https://github.com/umano/AndroidSlidingUpPanel).

该库需要你有2个孩子的意见。第一个是主要布局和第二个实际的滑动视图。现在,你的看法滑动只是一个占位符,所以你可以把你在那里想要的东西。如果你想添加一个ViewPager,这是你如何能做到这一点。

This library requires that you have 2 children views. The first one being the main layout and the second one the actual sliding view. Now, your sliding view is just a placeholder, so you can place anything you want in there. If you want to add a ViewPager, this is how you can do it.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <SlidingUpPanelLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <!-- Top Panel -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent" >
        </LinearLayout>

        <!-- Sliding Panel -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical" >

            <android.support.v4.view.ViewPager
                android:layout_width="match_parent"
                android:layout_height="match_parent" >
            </android.support.v4.view.ViewPager>
        </LinearLayout>
    </SlidingUpPanelLayout>

</RelativeLayout>

我们在这里是我们的活动(RelativeLayout的)主要布局,我们正在加入 SlidingPanelLayout 它。这里面的布局,我们定义了我们的主要布局是LinearLayout中(上图)和第二的LinearLayout(滑动面板),它是实际的滑动视图。现在,我们需要做的就是添加一个ViewPager这个滑动面板。

What we have here is the main layout of our Activity (RelativeLayout) and we're adding the SlidingPanelLayout to it. Inside this Layout, we've defined our main layout to be a LinearLayout (Top Panel) and a second LinearLayout (Sliding Panel) which is the actual sliding view. Now, all we need to do is add a ViewPager to this sliding panel.

这篇关于向上滑动面板与景观寻呼机标题地带的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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