2017-11-25 6 views
0

私は水平方向と垂直方向の両方を作成しようとしていますScrollableLayout。私は水平または垂直にスクロール可能なレイアウトにすることができましたが、私は両方の面でそれを作ることができませんでした。水平と垂直の両方向にスクロール可能なレイアウト

HorizontalScrollViewの中にScrollViewを入れ込もうとしましたが、それをすると横向きに収縮しました。私はJavaコードで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> 

:ここに私のコードです。

+0

この[質問]をご覧ください(https://stackoverflow.com/questions/2044775/scrollview-vertical-and-horizo​​ntal-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> 
関連する問題