2016-12-06 4 views
0

내 ViewPager가 작동하지만 텍스트가 페이지에 비해 너무 길 때 textView를 스크롤 할 수 없습니다. 다음은 각 페이지의 레이아웃에 대한 내 XML입니다. 상단 TextView는 고정 된 상태로 유지하고 하단 TextView는 페이지가 너무 긴 경우 스크롤됩니다. 어떤 도움을 주셔서 감사합니다.viewpager에서 내 textView를 스크롤 할 수있게하려면 어떻게합니까?

<?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="fill_parent" 
android:padding="10dp" > 

<TextView 
    android:id="@+id/reference" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:textColor="#128238" 
    android:textStyle="bold" 
    android:textSize="24dp"/> 

<TextView 
    android:id="@+id/details" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:textColor="#128238" 
    android:textSize="24dp" 
    android:layout_below="@+id/reference" 
    android:scrollbars="vertical" /> 

답변

1

당신은

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" > 
    android:id="@+id/content_main" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 

    <ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" > 

     <TextView 
      android:id="@+id/device_info" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      tools:text="device info" /> 

    </ScrollView> 

</RelativeLayout> 
+0

죄송처럼 ScrollViewTextView을 포장 할 수 wttribute은 무엇인가 - 네임 스페이스 도구의 텍스트? 그가 일하는거야? –

+1

xmlns : tools = "http://schemas.android.com/tools" –

+0

완벽한! 또한 layout_below 라인을 스크롤 뷰로 이동해야했습니다. – HGamble

관련 문제