2012-03-08 4 views
0

풍경 구성에서 조각 사이를 스크롤하려면 세로 스크롤보기가 필요합니다.verticle scrollview

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:scrollbars="vertical" > 

    <LinearLayout 
     android:id="@+id/linearLayout2" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" > 

     <fragment 
      android:id="@+id/fragment2" 
      android:name="com.kevtech.dup.frag1" 
      android:layout_width="wrap_content" 
      android:layout_height="match_parent" /> 

     <fragment 
      android:id="@+id/fragment1" 
      android:name="com.kevtech.dup.frag2" 
      android:layout_width="wrap_content" 
      android:layout_height="match_parent" /> 

     <fragment 
      android:id="@+id/fragment3" 
      android:name="com.kevtech.dup.frag3" 
      android:layout_width="wrap_content" 
      android:layout_height="match_parent" /> 
     </LinearLayout> 
    </ScrollView> 

스크롤 뷰가 수평으로 표시됩니다 : 이 내 코드입니다. 왜?
TX 탈리는

답변

0

당신은 당신의 LinearLayout에 해당 orientation 속성을 선언해야합니다. ScrollViewscrollbars 속성은 콘텐츠 렌더링 방법을 변경하지 않습니다. 콘텐츠 자체의 레이아웃에 따라 결정됩니다. 예를 들어

:

<LinearLayout 
    android:id="@+id/linearLayout2" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

당신이 방향을 선언하지 않으면, 내가 추측하고있어 수평에 LinearLayout 기본적으로, 당신의 문제입니다.