Android 如何仅滑动布局的一部分
我使用的是Jake Wharton的ViewPagerIndicator Library,我试图拥有与Tinder相同的浏览功能和许多最新的android应用程序(谈论起始屏幕)……我的意思是,只有布局的顶部是可滑动的,底部的较小部分显示Fb/Twitter/G+登录按钮 以下是我想要的屏幕截图: 我已经读过了,但我认为它不能满足我的需要Android 如何仅滑动布局的一部分,android,android-layout,viewpagerindicator,Android,Android Layout,Viewpagerindicator,我使用的是Jake Wharton的ViewPagerIndicator Library,我试图拥有与Tinder相同的浏览功能和许多最新的android应用程序(谈论起始屏幕)……我的意思是,只有布局的顶部是可滑动的,底部的较小部分显示Fb/Twitter/G+登录按钮 以下是我想要的屏幕截图: 我已经读过了,但我认为它不能满足我的需要 你们能帮帮我吗?既然你们要使用的是ViewPager,你们就不必考虑可切换的区域,因为ViewPager的高度/宽度决定了这一点 布局示例: <?xml
你们能帮帮我吗?既然你们要使用的是ViewPager,你们就不必考虑可切换的区域,因为ViewPager的高度/宽度决定了这一点 布局示例:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!-- Static content -->
<LinearLayout
android:id="@+id/ll_bottom"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_alignParentBottom="true"
android:background="@color/holo_blue_light"
android:orientation="vertical" />
<!-- ViewPager Indicator -->
<com.viewpagerindicator.LinePageIndicator
android:id="@+id/view_pager_indicator"
android:layout_width="fill_parent"
android:layout_height="20dp"
android:layout_above="@id/ll_bottom"
android:background="@color/holo_orange_light"
app:lineWidth="10dp"
app:selectedColor="#fff"
app:strokeWidth="10dp"
app:unselectedColor="#888888" />
<!-- ViewPager containing fragments with different views -->
<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/view_pager_indicator"
android:layout_alignParentTop="true"
android:background="@color/holo_red_light" />
</RelativeLayout>
结果:
说明:在蓝色区域中,您放置静态内容,它不会像示例中的Facebook按钮那样改变。橙色区域由ViewPagerIndicator使用,最后红色区域是ViewPager的区域。正如前面所说,只有这个区域可以游泳。谢谢:)你是个救生员!