2013-06-21 107 views
1

上午使用'ViewPagerIndicator'库来获取布局中间的标签。我将'TabPageIndicator'和'ViewPager'放置在'ScrollView'中。ViewpagerIndicator隐藏ScrollView中的标签内容

这里我的问题是标签是可见的,但内容视图是不可见的。我发现这使用'HierarchyViewer'。

我的布局如下

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/white_color" 
    android:fillViewport="true" > 

    <ViewAnimator 
     android:id="@+id/view__root" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" > 

     <LinearLayout 
       style="@style/LinearLayout.Vertical">     

      <RelativeLayout 
       .....>  
       <ImageView 
        ..... />  
       <TextView 
        .... /> 
      </RelativeLayout>     

      <LinearLayout 
       ......> 
       <TextView 
        ...../>     
      </LinearLayout>   

      <LinearLayout 
       .....> 
       <TextView 
        ..../> 
      </LinearLayout> 

      <LinearLayout 
       ........> 

       <com.google.android.maps.MapView 
        ......../> 
      </LinearLayout> 

       <RelativeLayout 
       .......> 

       <ImageView 
        ...../> 
       <ImageView 
        ...... /> 
       <ImageView 
        ....../> 
       <ImageView 
        ..../> 

       </RelativeLayout> 

      <LinearLayout 
       ......> 

       <ListView 
        ......./> 

      </LinearLayout> 

      <LinearLayout 
        android:id="@+id/layout_viewpageindicator" 
        android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:paddingLeft="10dp" 
      android:paddingRight="10dp"> 

      <com.viewpagerindicator.TabPageIndicator 
       android:id="@+id/indicator_1" 
       android:layout_height="match_parent" 
       android:layout_width="match_parent"/> 

      <android.support.v4.view.ViewPager 
       android:id="@+id/pager_1"    
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent"/> 

     </LinearLayout>    

    </LinearLayout> 

    </ViewAnimator> 
</ScrollView> 

请任何一个帮助我。 在此先感谢。

回答

1

您应该将一个android:fillViewport="true"添加到您的ScrollView并将其layout_height设置为"fill_parent"