私はすでにSOを検索しましたが、どの答えも役に立ちませんでした。
これが私のレイアウトxmlです:
<android.support.v7.widget.CardView
android:id="@+id/layout_building"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_8dp"
app:layout_constraintEnd_toStartOf="@+id/scrollview_nested_fragment_container"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/views_container">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/layout_building_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"/>
</ScrollView>
</android.support.v7.widget.CardView>
LinearLayout
コードを介して動的に子ビューを追加しています。また、ScrollView
タグを移動してラップしようとしましたCardView
が、それでもうまくいきません。これは制限ですか、CardView
それとも誰かがこれに対する実用的な解決策を知っていますか?
まず第一に、あなたの貴重な提案を手伝ってくれたすべての人に感謝します。実際の問題はにありますConstraintLayout
。app:layout_constraintBottom_toBottomOf="parent"
カードビューに制約を追加して設定するだけandroid:layout_height="0dp"
です。カードビューには境界が強制されていませんでした。デフォルトで子ビューへの境界を強制するLinearLayoutおよびRelativeLayoutとは異なります。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加