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>
결과 :
설명 : 청색 영역에서 당신은 당신의 예에서 페이스 북-버튼처럼 변경되지 않는 정적 콘텐츠를 배치합니다. 주황색 영역은 ViewPagerIndicator에 의해 사용되며, 마지막으로 빨간색 영역은 ViewPager 중 하나입니다. 이전과 마찬가지로이 영역 만 스 와이프 할 수 있습니다.
감사합니다. 당신은 생명의 은인입니다! – RidRoid