如果我在我的卡片视图中使用它作为foreground
,应用程序将在API 10之前崩溃。
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="@dimen/card_margin"
//android:foreground="?android:attr/selectableItemBackground"
android:elevation="3dp"
card_view:cardCornerRadius="@dimen/card_album_radius">
我正在进行一个大约七个月的项目,我的应用程序在每个API级别都工作到现在为止...这迫使我提高我的最小SDK。
能帮我解决这个问题,我该怎样绕过它。
我正在使用它
android:foreground="?attr/selectableItemBackground"
代替:
android:foreground="?android:attr/selectableItemBackground"
它是某种灰色的onClick而不是蓝色,但我不太关心颜色,所以这将解决现在的崩溃问题
用户android:foreground="?selectableItemBackgroundBorderless"
而不是android:foreground="?android:attr/selectableItemBackground"
使用?attr:
(或?
简写)而不是?android:attr
引用支持库,因此可以回到API 7。