做免费采集电影网站犯法吗,微信小程序页面模板,wordpress怎么做网站,网页相册制作因为项目中用到第三级菜单#xff0c;我们原有的界面框架已经不适用于该项目#xff0c;Android L出了新的cardview设计#xff0c;爬了下github发现有些高手已经把card整合为更方便调用的类库了#xff0c;我这个项目就准备试用一下其中的一个开源项目cardslib …因为项目中用到第三级菜单我们原有的界面框架已经不适用于该项目Android L出了新的cardview设计爬了下github发现有些高手已经把card整合为更方便调用的类库了我这个项目就准备试用一下其中的一个开源项目cardslib 而github我也是初次使用正好在项目中来熟悉使用方法 首先 cardslib项目地址https://github.com/gabrielemariotti/cardslib意大利的一位java/android工程师gabrielemariotti基于Android L 的cardview做的一个便于引用和扩展的卡片式布局可以fork一下到自己的代码仓库。 我的项目中主要用到其中的library-core和library-cards以下为作者提供的eclipse中引入该项目为类库的方法不得不说国外开发牛实在是太贴心了T_T文档写得尽善尽美我这种初级菜鸟也能按部就班的实现 Reference this project as a library in Eclipse If you would like to use this library-core in Eclipse you have to do these steps: clone a copy of this repository, or download it (outside eclipse workspace)import the code in your workspace starting from library folder. The Wizard will import the code in library-core/src/main. I suggest you naming it cardscore (or another name) instead of main.mark java(*) folder as source (click on folder - Build-Path - use as source folder). You can also remove the src folder, from the project.mark cardscore as Android Library (Properties - Android - Is library)add support library v4 rel.21add support cardview library v7 rel.21add support annotation library rel.21The library targets SDK 21 and works with minSdk14. In any cases you need to use API21 to compile library (Properties - Android)Clean and buildIf you would like to use this library-cards in Eclipse you have to do these steps: clone a copy of this repository, or download it (outside eclipse workspace)import the code in your workspace starting from library folder. The Wizard will import the code in library-cards/src/main. I suggest you naming it cardscore (or another name) instead of main.mark java(*) folder as source (click on folder - Build-Path - use as source folder). You can also remove the src folder, from the project.mark cardscore as Android Library (Properties - Android - Is library)add the cardscore as libraryThe library targets SDK 21 and works with minSdk14. In any cases you need to use API21 to compile library (Properties - Android)Clean and build 注意要点 1、需要anroid 21的SDK支持 2、把引用代码的main文件夹重命名并右键build-path该文件夹为use as source folder否则可能会造成代码冲突 3、将工程作为Android Libaray引入相应support library 引用后在build时和编译时分别出过一个问题 1、build后报错Found 4 versions of android-support-v4.jar in the dependency list 查看了报错信息是因为之前引用的滑动菜单的几个library中android-support-v4的版本和cardslib中所用版本不同。拷cardslib中的v4过去就行了 2、运行时报错2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes; 应该是导入的包和以前的导入有冲突解决办法简单粗暴我把我的项目中libs文件夹下的包全部拷出来然后重建这个文件夹手动一个个拷进去检查直到0 error为止可能有些运行时要用的包没有拷到以后运行时报错的时候再根据提示单独拷就可以了最后在stackoverflow找到原因引用的library-core库中新版本的support-v4包已经包含了support-annotations的内容删去annotations包即可 The problem is that android-support-annotations.jar used to be a separate library containing the android annotations, but for some reason these annotations are already included in recent versions of the android-support-v4.jar file. 转载于:https://www.cnblogs.com/melonrice/p/4103997.html