最近、Android Studio 2.2 には、設計がはるかに簡単になる新しい ConstraintLayout がありますが、 や とは異なりRelativeLayout
、を使用して を囲むことLinearlayout
ができません。 これは可能ですか? 可能であれば、どのようにすればよいですか?ScrollView
ConstraintLayout
つまり
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp">
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp">
<!-- Have whatever children you want inside -->
</android.support.constraint.ConstraintLayout>
</ScrollView>
ベストアンサー1
android:fillViewport="true"
ScrollViewに追加してみてください。
解決策はここに見つかりました:LinearLayout が ScrollView 内で拡張されない