我將cardview放在滾動視圖內,我們希望看到在底部應顯示邊框(請參見下圖)。但不是。問題是我無法滾動到底部查看cardview的邊框。CardView底部邊框在ScrollView內切斷android
SO上的所有解決方案都是將layout_margins更改爲填充,但如果我們想顯示邊框,則不適用cardview。我基本上嘗試了一切。但仍然沒有工作。
圖片1.滾動到底看不到邊界
圖2我們可以看到,頂部邊框
以下是XML代碼
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
...
</LinearLayout>
</CardView>
</LinearLayout>
引用: ScrollView doesn't scroll to the bottom
ScrollView cuts off the top and leaves space at the bottom
I can't show LinearLayout at bottom to scroll view
Android ScrollView refuses to scroll to bottom
你可以附加一個屏幕截圖,幫助我們更好地瞭解發生了什麼事? – Vucko
@Vucko添加了屏幕截圖,謝謝 – Cheng