2017-11-25 13 views
0

나는 수평으로도 수직으로도 만들려고합니다 ScrollableLayout. 수평 적으로나 수직으로 스크롤 가능한 레이아웃을 만들었지 만 양면으로 만들 수는 없었습니다.ScrollableLayout 가로 및 세로 모두 만들기

HorizontalScrollView 안에 ScrollView을 넣으려고했는데, 그렇게하면 가로가 줄어 듭니다. 여기 내 코드는 다음과 같습니다.

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

    <ScrollView 
     android:id="@+id/mainLayout" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 


    </ScrollView> 

</HorizontalScrollView> 

내 Java 코드로 내보기를 추가하고 있습니다.

+0

이 [질문] 참조 (https://stackoverflow.com/questions/2044775/scrollview-vertical-and-horizontal-in-android) – FarshidABZ

답변

0

나는 당신이 원하는 것을하는 표준 라이브러리에는 아무것도 없다고 생각한다. 이 페이지의 어딘가에서 TableLayout을 내부에 넣으려는 의견에 대해 말하면, 아마도 타사 구성 요소 (예 : TableFixHeaders)가 더 도움이 될 것입니다.

이 코드는 실제로 나를 위해 일한
0

:

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 
    <ScrollView 
     android:id="@+id/verticalScroll" 
     android:layout_width="match_parent" 
     android:scrollbars="horizontal|vertical" 
     android:layout_height="match_parent" 
     android:fillViewport="true"> 

     <HorizontalScrollView 
      android:id="@+id/mainLayout" 
      android:layout_width="wrap_content" 
      android:scrollbars="horizontal|vertical" 
      android:layout_height="wrap_content"> 


     </HorizontalScrollView> 

    </ScrollView> 

</LinearLayout>