0

我想把ViewView和TextView放在ViewPager圈指標中。我想在Imageview下面顯示文本,但是文本通過具有圓圈指示符的頁腳隱藏。請建議如何在佈局中調整其中三個。佈局是:如何在ViewPager圈指標中調整圖像和文字

ViewPager:

<FrameLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_marginBottom="1dp" 
      android:layout_marginTop="1dp" 
      android:layout_weight="0.8" 
      android:background="@color/white" 
      android:orientation="vertical" > 

      <!-- ViewPager --> 

      <android.support.v4.view.ViewPager 
       android:id="@+id/viewPager" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" /> 
      <!-- Footer --> 
     <include layout="@layout/footer" /> 
     </FrameLayout> 

頁腳,其具有圓指示符:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:background="#ffffff" 
android:layout_gravity="bottom" 
android:orientation="vertical" > 

<Button android:layout_height="wrap_content" android:layout_width="wrap_content" 
android:id="@+id/btn1" 
android:layout_centerHorizontal="true" 
android:layout_centerVertical="true" 
android:background="@drawable/rounded_celll" /> 

<Button android:layout_height="wrap_content" android:layout_width="wrap_content" 
android:id="@+id/btn2" 
android:layout_toRightOf="@id/btn1" 
android:layout_marginLeft="5dip" 
android:layout_centerHorizontal="true" 
android:layout_centerVertical="true" 
android:background="@drawable/rounded_celll" /> 
</RelativeLayout> 

這是將被顯示在ViewPager的佈局1:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="@color/white" 
android:orientation="vertical" 
android:layout_gravity="top|center"> 

<ImageView 
    android:id="@+id/imageView1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/sp1" 
    android:layout_weight="0.7"/> 

<TextView 
    android:id="@+id/textView1" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:textSize="10sp" 
    android:layout_weight="0.3" 
    android:textColor="@color/black" 
    android:textStyle="bold" 
    android:text="First Layout First Layout First Layout First Layout " 
    /> 

回答

0
Lets say as of now you have three layouts - 
1) Main layout (which has view pager) 
2) footer layout 
3) layout having imageView and textView 

To achieve your goal, you can do below steps - 
remove "<include layout="@layout/footer" from mail layout and add it as a part of 3) layout. 
This footer view will also be part of viewPager.