gpt4 book ai didi

android - ?安卓 :attr/selectableItemBackground` requires API level 11 (current min is 10)

转载 作者:太空宇宙 更新时间:2023-11-03 11:00:49 25 4
gpt4 key购买 nike

如果我在我的卡片 View 中将其用作前台,应用程序将在 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。

关于android - ?安卓 :attr/selectableItemBackground` requires API level 11 (current min is 10),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43735701/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com