2014-09-17 2 views
0

내 안드로이드 응용 프로그램의 각 화면 내에서 스크롤 할 수 있기를 원합니다. 스크롤하면 탭 막대도 스크롤 할 수 있습니다. 내 코드는 작동합니다. 그러나 탭 막대가있는 화면으로 가면 탭 막대가 보이지 않습니다. 위로 스크롤해야하는 탭 막대가 보입니다. 기본적으로 탭 표시 줄을 볼 수있는 방법이 있습니까? 감사tabhost xml의 ScrollView - android

내 tab_host.xml 코드

<?xml version="1.0" encoding="utf-8"?> 

<TabHost xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
     android:id="@android:id/tabhost"> 

<ScrollView 
    android:layout_height="fill_parent" 
      android:layout_width="fill_parent" > 
    <LinearLayout 
      android:id="@+id/LinearLayout01" 
      android:orientation="vertical" 
      android:layout_height="fill_parent" 
      android:layout_width="fill_parent"> 

      <TabWidget 
       android:id="@android:id/tabs" 
       android:layout_height="wrap_content" 
       android:layout_width="fill_parent"> 
      </TabWidget> 

      <FrameLayout 
       android:id="@android:id/tabcontent" 
       android:layout_height="fill_parent" 
       android:layout_width="fill_parent"> 
      </FrameLayout> 

    </LinearLayout> 

+0

TabWidget이 보이지 않는 것을 의미합니까? FrameLayout에 문제가있는 경우 layout_height = "0dp"및 layout_weight = "1"을 설정하십시오. –

+0

또한 연습을 위해 "fill_parent"가 아닌 "match_parent"를 사용하십시오. –

+0

이 작동하지 않습니다. ( – user3156801

답변

0

ViewPager는 당신이 필요하고 슬라이딩 탭 클래스와 함께.

<android.support.v4.view.ViewPager 
     android:id="@+id/mPager" 
     android:layout_width="match_parent" 
     android:layout_height="0px" 
     android:layout_weight="1" 
     android:background="@color/white"/> 
+0

감사합니다. 어떻게 사용합니까? – user3156801

+0

이메일을 보내주세요. 이메일을 보내주세요. 슬라이더 클래스를 첨부합니다. 잘 사용하는 방법에 대한 샘플 코드로. – Mike

+0

감사 ... [email protected] – user3156801