【发布时间】:2015-04-16 15:20:48
【问题描述】:
应用 Proguard 后,我的 CardView 的阴影在 Lollipop 设备上消失了。我没有定义任何规则来保护这个库,因为我没有读过它是必要的。
我附上几张截图,第一次没有运行proguard,第二次运行后。
这是我的xml
<LinearLayout 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"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<android.support.v7.widget.CardView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_margin="4dp"
app:contentPadding="10dp"
app:cardUseCompatPadding="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text 1"/>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_margin="4dp"
app:contentPadding="10dp"
app:cardUseCompatPadding="false">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text 2"/>
</android.support.v7.widget.CardView>
</LinearLayout>
Activity 只是将 xml 设置为内容,并没有做更多的事情。
如您所见,我使用了cardUseCompatPadding 的两种可能性,但它并没有解决this thread 中定义的问题。
有人知道为什么proguard会打破我的影子吗?
【问题讨论】:
-
如果您找到了自己的解决方案,您可以发布自己问题的答案。
-
谢谢,我要复制下来
标签: android proguard android-cardview