底部的android寻呼机标签带获取整个片段
我想看看 首先会有对片段的提示,最后会出现botton android pagertabstrip,但不知何故pagertabstip占据了整个页面。 我的代码在下面底部的android寻呼机标签带获取整个片段,android,android-fragments,pager,Android,Android Fragments,Pager,我想看看 首先会有对片段的提示,最后会出现botton android pagertabstrip,但不知何故pagertabstip占据了整个页面。 我的代码在下面 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black" >
<LinearLayout
android:id="@+id/adview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/black"
android:orientation="vertical" >
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/tabs"
android:layout_below="@+id/adview"
tools:context=".MainActivity" />
<com.astuetz.PagerSlidingTabStrip
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="48dip"
android:layout_alignParentBottom="true"
android:layout_below="@+id/adview"
android:background="@color/black" >
</com.astuetz.PagerSlidingTabStrip>
</RelativeLayout>
如何使用tabstrip bottom和pager view top,您应该使用
layout\u gravity=“bottom”
,因为ViewPager扩展了FrameLayout
,所以它的参数与FrameLayout
使用的参数相同android:layout\u alignParentBottom
用于RelativeLayout
编辑:
重新阅读您的问题和XML。我以为你在使用标准,但这正是你想要的:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black" >
<LinearLayout
android:id="@+id/adview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/black"
android:orientation="vertical" >
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/tabs"
android:layout_below="@+id/adview"
tools:context=".MainActivity" />
<com.astuetz.PagerSlidingTabStrip
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="48dip"
android:layout_alignParentBottom="true"
android:background="@color/black" >
</com.astuetz.PagerSlidingTabStrip>
</RelativeLayout>
从选项卡中删除以下的android:layout_=“@+id/adview”
。它使选项卡在提示后立即启动。您应该使用layout\u gravity=“bottom”
,因为ViewPager
扩展了FrameLayout
,所以它的参数与FrameLayout
使用的参数相同android:layout\u alignParentBottom
用于RelativeLayout
编辑:
重新阅读您的问题和XML。我以为你在使用标准,但这正是你想要的:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black" >
<LinearLayout
android:id="@+id/adview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/black"
android:orientation="vertical" >
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/tabs"
android:layout_below="@+id/adview"
tools:context=".MainActivity" />
<com.astuetz.PagerSlidingTabStrip
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="48dip"
android:layout_alignParentBottom="true"
android:background="@color/black" >
</com.astuetz.PagerSlidingTabStrip>
</RelativeLayout>
从选项卡中删除以下的android:layout_=“@+id/adview”
。它会使选项卡在弹出视图后立即启动。使用-布局\u gravity=“bottom”
为什么??因为,FrameLayout
是通过ViewPager
使用-layout\u gravity=“bottom”
为什么??因为,FrameLayout
是由ViewPager
扩展的,请使用以下命令:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/adview"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/black"
android:orientation="vertical" >
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.9"
android:background="#ff0000"
tools:context=".MainActivity" />
<com.astuetz.PagerSlidingTabStrip
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.1"
android:background="@color/black" >
</com.astuetz.PagerSlidingTabStrip>
</LinearLayout>
使用以下方法:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/adview"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/black"
android:orientation="vertical" >
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.9"
android:background="#ff0000"
tools:context=".MainActivity" />
<com.astuetz.PagerSlidingTabStrip
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.1"
android:background="@color/black" >
</com.astuetz.PagerSlidingTabStrip>
</LinearLayout>
嗨,它在相对布局中,因为我想在片段上查看浮动,嗨,它在相对布局中,因为我想在片段上查看浮动,嗨,它在相对布局中,因为我想在片段上查看浮动我看错了你的问题,我编辑了我的答案。现在应该是正确的了。非常感谢,它像魔术一样工作,似乎我不明白相对视图是如何工作的:(有效!!但是,有一种方法可以将'underline'选择器设置为'upperline'?您好,它在相对布局中,因为我想在片段上查看浮动。我看错了您的问题,我编辑了我的答案。现在应该是正确的。非常感谢,它像魔术一样工作,似乎我不明白相对视图是如何工作的:(有效!!但是,有一种方法可以将“underline”选择器设置为“upperline”?它也有效,但在viewpager上adview不浮动。感谢帮助meits也有效,但在viewpager上adview不浮动。感谢帮助我