正如标题状态,我试图把滚动型内CardView,但CardView海拔阴影正在不过关被它的父...Android的滚动型剪裁孩子海拔阴影
这是布局XML :
<FrameLayout
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:context=".TestScrollViewActivity">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="128dp"
android:background="?colorPrimary"
android:gravity="bottom"
android:minHeight="?actionBarSize"/>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:clipToPadding="false"
android:paddingBottom="40dp"
android:paddingTop="60dp">
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="4dp"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="0dp">
<LinearLayout
android:layout_width="400dp"
android:layout_height="600dp"
android:orientation="vertical">
</LinearLayout>
</android.support.v7.widget.CardView>
</ScrollView>
</FrameLayout>
,我发现的唯一的解决方法是将填充添加到父滚动型或保证金添加到子CardView ...
是否有任何选项,以防止这种不使用发生填充/保证金?
谢谢。
编辑:
这是布局的样子没有设置父滚动视图的填充,因为它可以看出,左边和右边的阴影被切断:
现在如果填充被添加到父滚动型面,阴影正在绘制正确,因为它可以在这里看到:
所以,我在这里主要的问题是实现的唯一途径?或有标签或配置文件中的配置ent视图允许正确绘制它的子视图?
请分享它的外观和屏幕截图的样子,以及它的外观。 –
我只是添加它们 – vicmns