2013-01-22 4 views
1

여기에 두 개의 파일이 있습니다. 뷰 페이지에서 세로로 스크롤 할 수있게하고 싶습니다. 페이지의 내용이 페이지의 크기를 초과합니다. 내용이 페이지 크기를 초과하더라도 ... 나는 스크롤을 얻지 못합니다. Plz 도움.뷰 페이지의 세로 스크롤

<?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="wrap_content" 
    android:fillViewport="true" 
     > 
    <RelativeLayout  

    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 
    <RelativeLayout  
     android:id="@+id/secAct1" 
    android:layout_height="25dip" 
    android:layout_width="match_parent" 
    android:background="#000000" 
    android:layout_alignParentBottom="true" 
     > 
      <TextView 
     android:id="@+id/cn1" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:paddingLeft="10dip" 
     android:textColor="@color/white" 
     android:textSize="15sp" 
     android:text="cn" 
     /> 
     <TextView 
     android:id="@+id/si1" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" 
     android:paddingRight="10dip" 
     android:layout_alignParentRight="true" 
     android:textColor="@color/white" 
     android:textSize="15sp" 
     android:text="si" 
     /> 
    </RelativeLayout> 
    <LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/secAct1" 
    android:orientation="vertical" 
    android:gravity="center" 
    android:padding="30dip"> 
    <Button 
    android:id="@+id/submitAll"  
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Submit Responses"  
    /> 
    <TextView 
    android:id="@+id/lp" 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent" 
    android:textColor="@color/white" 
    android:text="Thank you for your valuable responses!\n On submitting, you will not be able to changes your       responses.\nYou responses will be uploaded when your device is connected to the internet.\nThank you for your  valuable responses!\n On submitting, you will not be able to changes your responses.\nYou responses will be uploaded when your device is connected to the internet.Thank you for your valuable responses!\n On submitting, you will not be able to changes your responses.\nYou responses will be uploaded when your device is connected to the internet.Thank you for your valuable responses!\n On submitting, you will not be able to changes your responses.\nYou responses will be uploaded when your device is connected to the internet.\nThank you for your valuable responses!\n On submitting, you will not be able to changes your responses.\nYou responses will be uploaded when your device is connected to the internet.Thank you for your valuable responses!\n On submitting, you will not be able to changes your responses.\nYou responses will be uploaded when your device is connected to the internet.Thank you for your valuable responses!\n On submitting, you will not be able to changes your responses.\nYou responses will be uploaded when your device is connected to the internet.\nThank you for your valuable responses!\n On submitting, you will not be able to changes your responses.\nYou responses will be uploaded when your device is connected to the internet.Thank you for your valuable responses!\n On submitting, you will not be able to changes your responses.\nYou responses will be uploaded when your device is connected to the internet.Thank you for your valuable responses!\n On submitting, you will not be able to changes your responses.\nYou responses will be uploaded when your device is connected to the internet.\nThank you for your valuable responses!\n On submitting, you will not be able to changes your responses.\nYou responses will be uploaded when your device is connected to the internet.Thank you for your valuable responses!\n On submitting, you will not be able to changes your responses.\nYou responses will be uploaded when your device is connected to the internet." 
     > 
     </TextView> 


     </LinearLayout> 
      </RelativeLayout></ScrollView> 

텍스트 뷰는 버튼이 화면 하단에도 불구하고, CN &시 버튼 위에 있도록 먼저 당신이 그것을 가지고 들어 다음 파일

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

    <LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/fragQue" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    > 

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

     android:background="@drawable/radialback" 
     > 
    <android.support.v4.view.PagerTabStrip 
      android:id="@+id/pager_title_strip" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_gravity="top" 
      android:paddingTop="@dimen/fQ_P" 
      android:paddingBottom="@dimen/fQ_P" 
      android:background="@color/yellow" 
      android:textColor="@color/textGray" 
      /> 
    </android.support.v4.view.ViewPager > 

    </LinearLayout> 
+0

https://github.com/JakeWharton/Android-DirectionalViewPager 이것을 확인하십시오 –

답변

1

, 안 네가 원하는 방식대로 일해라. 당신이 &시 버튼 아래에 CN과 상단에 버튼 및 텍스트보기를 제출하고 스크롤 할 수 줄 것이다

android:layout_above="@+id/secAct1" 
//should be 
android:layout_below="@+id/secAct1" 

. 두 번째 상대 레이아웃의 상단에있는 CN &시 버튼을 원하는 경우 , 그래서 당신은 수도의 viewpager는 기본 스크롤이 아닌지 모르겠어요, 두 번째 파일에 관해서는

android:layout_alignParentBottom="true" 
//to 
android:layout_alignParentTop="true" 

변경 scrollview로 랩핑하면됩니다.

+0

해당 작업 !!!!! 이유를 설명 할 수 있습니다 –

+0

솔직히 말해서, 원래 코드가 왜 당신이 원하는 것을하지 않고 있는지 전혀 모르겠습니다. 내가 생각할 수있는 유일한 것은 상대 레이아웃을 부모 상대 레이아웃의 맨 아래에 맞춰 놓으면 부모 레이아웃 위에 'android : layout_above = "@ + id/secAct1'이 설정된다는 것입니다. 짐작. – Z30Dragon

관련 문제