简体   繁体   English

android CardView替代

[英]android CardView alternative

I was looking into Google's Material Design CardView, and love the concept, but realize that CardView was only available for devices running on Android 5.0 and up. 我一直在研究Google的Material Design CardView,但很喜欢这个概念,但意识到CardView仅适用于运行Android 5.0及更高版本的设备。 Since I want to quickly deploy the new design our application, and do not want to wait until most devices are upgraded until 5.0, I was wondering if there would be any other alternative to CardView that would support devices from 4.0 and up. 由于我想快速部署我们应用程序的新设计,并且不想等到大多数设备升级到5.0以后,因此我想知道CardView是否有其他替代方案可以支持4.0及更高版本的设备。

https://developer.android.com/training/material/lists-cards.html https://developer.android.com/training/material/lists-cards.html

Thanks in advance 提前致谢

You can use CardView also with a lower API since it's supported. 您也可以通过较低的API使用CardView ,因为它受支持。 Simply add the following lines in your gradle file: 只需在gradle文件中添加以下行:

dependencies {
    compile 'com.android.support:appcompat-v7:21.0.+'
    compile 'com.android.support:cardview-v7:+'
}

Maybe you should have a look over there (using support library) : https://stackoverflow.com/a/24468117/4232337 也许您应该去那里看看(使用支持库): https : //stackoverflow.com/a/24468117/4232337

As mentionned, 如前所述

The v7 Support Libraries r21 and above includes the following material design features: v21支持库r21及更高版本包含以下材料设计功能:

Material design styles for some system widgets when you apply one of the Theme.AppCompat themes. 当您应用Theme.AppCompat主题之一时,某些系统小部件的材料设计样式。

Color palette theme attributes in the Theme.AppCompat themes. Theme.AppCompat主题中的调色板主题属性。

The RecyclerView widget to display data collections. RecyclerView小部件可显示数据收集。

The CardView widget to create cards. CardView小部件以创建卡。

The Palette class to extract prominent colors from images. Palette类从图像中提取突出的颜色。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM