如何在Android Studio中使用Android滑动面板制作示例演示项目 [英] How to make a sample demo project with Android Sliding panel in Android Studio

查看:383
本文介绍了如何在Android Studio中使用Android滑动面板制作示例演示项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于像我这样的完整初学者,谁能告诉我如何使用" https:/创建示例演示应用程序/github.com/umano/AndroidSlidingUpPanel "在Android Studio版本"0.8.6"中.

For a complete beginner like me, can anyone tell me how to just create sample demo application using "https://github.com/umano/AndroidSlidingUpPanel" in Android Studio version "0.8.6".

我已按照上述步骤操作,以包含Android滑动面板库 1)从以下位置下载最新的稳定版本" https://github.com/umano/AndroidSlidingUpPanel/发布"

I have followed these mentioned steps in order to include the Android Sliding panel library 1) Download the latest stable release from the following location"https://github.com/umano/AndroidSlidingUpPanel/releases"

2)提取zip文件夹

2)extract the zip folder

从您的视频"> https://www.youtube.com/watch?v = 1MyBO9z7ojk "

3)在根目录中创建一个名为"libraries"(应用程序名称为"slidingPanelTesting2")的文件夹

3)Created a folder in the root directory with name "libraries" (application name is "slidingPanelTesting2")

4)将提取的目录复制到文件夹库中

4)Copied the extracted directory in to the folder libraries

5)在settings.gradle中,将第一行代码更改为

5) In the settings.gradle changed the first line of code to

include ':app', ':libraries:AndroidSlidingUpPanel:AndroidSlidingUpPanel-2.0.1'

6)在项目结构中(文件->项目结构) 单击模块"部分的应用",在依赖关系"选项卡中添加了模块依赖关系"

6)In the poject structure (file->projectstructure) click on "app" of modules section, In Dependencies tab added the module Dependency

libraries:AndroidSlidingUpPanel:AndroidSlidingUpPanel-2.0.1

7)单击应用"后,出现以下错误 Error:Configuration with name 'default' not found.

7)After clicking Apply I get the following error Error:Configuration with name 'default' not found.

如果有人可以回答,那将是很棒的,因为我有很多问题相同但又没有任何答案的帖子

It would be great if some one can answer as I have many posts with the same problem without any answers

推荐答案

将此库添加到Android Studio项目中要容易得多.首先,撤消您之前的所有步骤-完全不需要.

It's much easier to add this library to your Android Studio project. First of all undo all of your previous steps - they're simply not needed.

打开app文件夹的build.gradle文件,并将以下行添加到依赖项:

Open the build.gradle file of your appfolder and add the following lines to the dependencies:

dependencies {
    repositories {
        mavenCentral()
    }
    compile 'com.sothree.slidinguppanel:library:+'
}

完成! Android Studio可能会抱怨存储库中的内容不属于那里,因此只需将其移动到项目本身的build.gradle文件中,而不是应用模块中即可.

Done! Android Studio may complain that the repositories stuff doesn't belong there so just move it to the build.gradle file of the project itself instead of the app module.

这是您的build.gradle文件的最终外观:

Here's how your build.gradle files should look like in the end:

正如注释中提到的Scott Barta,如果您的存储库列表中已经有jcenter(),则不需要mavenCentral(). jcenter()似乎是mavenCentral()的超集-在此处了解更多: SO:Android buildscript储存库. jcenter VS mavencentral

As Scott Barta mentioned in the comments, mavenCentral() isn't needed if there's already jcenter() in your repository list. jcenter() seems like a superset of mavenCentral() - Read more here: SO: Android buildscript repositories. jcenter VS mavencentral

这篇关于如何在Android Studio中使用Android滑动面板制作示例演示项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆