ScrollView 内に ConstraintLayout を配置することは可能ですか? 質問する

ScrollView 内に ConstraintLayout を配置することは可能ですか? 質問する

最近、Android Studio 2.2 には、設計がはるかに簡単になる新しい ConstraintLayout がありますが、 や とは異なりRelativeLayout、を使用して を囲むことLinearlayoutができません。 これは可能ですか? 可能であれば、どのようにすればよいですか?ScrollViewConstraintLayout

つまり

<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 内で拡張されない

おすすめ記事