【发布时间】:2016-07-25 16:14:06
【问题描述】:
我把cardview放在scrollview里面,我们希望看到底部应该显示边框(见下图)。但它不是。问题是我不能滚动到底部看到cardview的边框。
关于 SO 的所有解决方案都是将 layout_margins 更改为 paddings,但如果我们想显示边框,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
【问题讨论】:
-
您能否附上屏幕截图以帮助我们更好地了解发生了什么?
-
@Vucko 屏幕截图已添加,谢谢
标签: android scrollview cardview