我将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