在这里记录一下使用CardView时用图片作为背景的方法:

     /*首先设置imageView作为图片的背景*/     "          android:layout_height = “match_parent"          android:background = “@drawable/background”/>     <          ...               />

在布局的开始添加ImageView为背景图片就行。
另外:改变 CardView背景颜色要使用:

app:cardBackgroundColor = ""

使用android:background = “” 是无效的

为5.0以上设备添加点击时的水波纹效果使用:

android:foreground = "?attr/selectableItemBackground"

更多相关文章

  1. Android中Intent的使用示例
  2. 以Android(安卓)Library的方式使用 for
  3. android手把手教你开发launcher(一)(AndroidStudio版)
  4. Retrofit系列文章翻译7—在请求体里发送对象
  5. Android(安卓)学习路线
  6. Android(安卓)TextView使用及性能优化
  7. 箭头函数的基础使用
  8. NPM 和webpack 的基础使用
  9. Python list sort方法的具体使用

随机推荐

  1. android获取wifi信号强度
  2. Android(安卓)ScrollView 内部控件 layou
  3. Android(安卓)设置让EditText不自动获取
  4. android button 上添加图片
  5. android webview
  6. Android(安卓)PureMVC
  7. android 自动化(1)
  8. 解决java.lang.RuntimeException: Unable
  9. Android的简易弹幕
  10. Android(安卓)Compatibility zoom dialog