2017-05-04 4 views
0

エディタのように機能し、レイアウトに要素をドラッグ&ドロップできるアプリケーションを開発していますが、私のレイアウトは時々画面サイズよりも大きいので、私はレイアウト上で両方の方法でスクロールを許可する必要があります。2次元スクロールビュー内の相対レイアウトレイアウトの制限にビューが追加されたときにサイズが変更される

私はこのようにそれをやっている:

<ScrollView 
    android:id="@+id/layoutScroll" 
    android:layout_width="0dp" 
    android:layout_height="0dp" 
    android:layout_marginBottom="16dp" 
    android:layout_marginEnd="8dp" 
    android:layout_marginLeft="8dp" 
    android:layout_marginRight="8dp" 
    android:layout_marginStart="8dp" 
    android:layout_marginTop="16dp" 
    app:layout_constraintBottom_toTopOf="@+id/trashBtn" 
    app:layout_constraintLeft_toLeftOf="parent" 
    app:layout_constraintRight_toRightOf="parent" 
    app:layout_constraintTop_toBottomOf="@+id/LabelTypeTextView" 
    > 

    <HorizontalScrollView 
     android:id="@+id/layoutScrollHor" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     > 

     <RelativeLayout 
      android:id="@+id/labelCanvas" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_marginBottom="8dp" 
      android:layout_marginEnd="8dp" 
      android:layout_marginLeft="8dp" 
      android:layout_marginRight="8dp" 
      android:layout_marginStart="8dp" 
      android:layout_marginTop="8dp" 
      android:clipToPadding="false" 
      android:clipChildren="false" 
      android:background="@drawable/label_canvas" 
      app:layout_constraintBottom_toTopOf="@+id/trashBtn" 
      app:layout_constraintLeft_toLeftOf="parent" 
      app:layout_constraintRight_toRightOf="parent" 
      app:layout_constraintTop_toBottomOf="@+id/LabelTypeTextView"> 

     </RelativeLayout> 
    </HorizontalScrollView> 
</ScrollView> 

問題は、私は私の相対的なレイアウトの最後に要素を追加するときに、レイアウトが、それは寸法だ増加し、私はそれだけの要素をクリップしたかったということです。

ビジュアル例:ここ Example

ピンク行がレイアウトの終わりであったが、私はそれを完全にレイアウトの内部に滞在することができない位置に要素をドラッグするとき、それは追加のレイアウトのサイズを変更青いスペース。

提案がありますか?

答えて

0

は、Androidを試してみてください。ScrollView

でfillViewport =「true」を
+0

は答えてくれてありがとう、しかし、私はすでに試したし、それが動作しませんでした... –

関連する問題