- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
如果我在我的卡片 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/
有什么区别: android:background="?selectableItemBackground" android:background="?attr/selectableItemBackgr
在构建布局时,我注意到 selectableItemBackground 的背景颜色与 UI 其余部分的背景颜色不匹配。为了缓解这种情况,我想导入 {android_sdk}/platforms/{p
我正在尝试对遗留代码实现 Material Design。 我想要一个按钮在点击时产生链式 react ,但它什么也没显示。 我正在使用默认的 ?android:attr/selectableItem
目前,当我点击这个按钮时,我有这样的效果: “按钮”就是这样的 ImageView: 所以我的问题是:我怎样才能在这个 ImageView(与 View 类型无关)上使用 selectableIte
我正在尝试在 Android 应用程序中使用 RecyclerView。我将 RecyclerView 示例项目导入到 Android Studio 中,它运行良好。 我想让回收站 View 中的项目
我正在尝试使 ImageButton 使用android:background="?attr/selectableItemBackground" 但我的应用崩溃了。我只是关注这个 answer还有这个
现在我的 View (framelayout)有 android:background="?android:attr/selectableItemBackground" 我想给它添加
我正在为列表使用 RecyclerView。我找到了一个非常好的解决方案来提供列表点击反馈和涟漪(在 Lollipop 上)。基本上我给我的行布局属性: android:background="?an
我正在尝试将无边框背景设置为按钮(按下时必须突出显示)。为此,我尝试设置: android:background="?android:attr/selectableItemBackground" (如
XML 布局 这是我在 recyclerview 中的行的布局,我之前使用过“?attr/selectableItemBackground”并且效果很好,但没有任何东西可以使这种链式 react
我一直使用 android:background="?selectableItemBackground" 在单击 View (例如 LinearLayout)时产生涟漪效果。我想我在某处读到它向后兼容
我从 Google IO Schedule 应用源 (https://github.com/google/iosched) 复制了一个文件,即 selected_navdrawer_item_back
我尝试在 recyclerview 中使用 selectableItemBackground,我测试了一个简单的演示,它正在运行。 这是布局和样式: 风格:
我的 xml 文件的第 59 行: 错误发生是因为 ?attr/属性。如果我将它替换为#FF00000 或其他内容,一切正常。这种崩溃并不经常发生。 07-28 19:16:46.686
我通过 android - apply selectableItemBackground in xml with support v7 偶然发现了表达式 ?attr/selectableItemBac
我有一个标签布局 为了实现波纹动画,我必须将背景更改为 android:background="?attr/selectableItemBackground" 它启用波纹动画,但默认颜色是灰色,我希
我在 CardView 上添加了 selectableItemBackground,它显示在 recyclerview 上。每个 CardView 显示文本和图像。每张卡片都可以选择,为了在点击时添加
我有几个按钮需要椭圆形边框。 所以我在 capsule_border.xml 中有这个 我会在需要的地方使用 android:background="@drawable/ca
在编写我的 android 应用程序时,我使用了 android:background="?android:attr/selectableItemBackground" 我尝试寻找包含源代码的 att
我注意到属性 ?attr/selectableItemBackground 创建的效果仅在我长按 View 时显示。但我希望它在每次点击时都显示出来。 View 是可点击的并且有点击监听器。 怎么做?
我是一名优秀的程序员,十分优秀!