eclipse中怎样导入android-support-v7-appcompat
答案:2 悬赏:50 手机版
解决时间 2021-02-26 03:45
- 提问者网友:人生佛魔见
- 2021-02-25 22:45
eclipse中怎样导入android-support-v7-appcompat
最佳答案
- 五星知识达人网友:七十二街
- 2021-02-25 23:46
make sure you have downloaded the android support library using the sdk manager.
create a library project and ensure the required jar files are included in the project's build path:
select file > import.
select existing android code into workspace and click next.
browse to the sdk installation directory and then to the support library
folder. for example, if you are adding the cardview project, browse to
/extras/android/support/v7/cardview/.
click finish to import the project. for the v7 cardview project, you
should now see a new project titled android-support-v7-cardview.
in the new library project, expand the libs/ folder, right-click each .jar file and select build
path > add to build path. for example, when creating the the v7
cardview project, add the android-support-v7-cardview.jar file to the
build path.
right-click the library project folder and select build path > configure build path.
in the order and export tab, check the .jar files you just added to the
build path, so they are available to projects that depend on this
library project. for example, the cardview project requires you to
export the android-support-v7-cardview.jar file.
uncheck android dependencies.
click ok to complete the changes.
you now have a library project for your selected support library that you can use with one or more application projects.
add the library to your application project:
in the project explorer, right-click your project and select properties.
in the category panel on the left side of the dialog, select android.
in the library pane, click the add button.
select the library project and click ok. for example, the appcompat project should be listed as android-support-v7-cardview.
in the properties window, click ok.
需要注意project.properties里的target尽量高点比较好,如果低了可能会出现类似
no
resource found that matches the given name '@style/theme.appcompat.light'的问题。我选的是23。
create a library project and ensure the required jar files are included in the project's build path:
select file > import.
select existing android code into workspace and click next.
browse to the sdk installation directory and then to the support library
folder. for example, if you are adding the cardview project, browse to
/extras/android/support/v7/cardview/.
click finish to import the project. for the v7 cardview project, you
should now see a new project titled android-support-v7-cardview.
in the new library project, expand the libs/ folder, right-click each .jar file and select build
path > add to build path. for example, when creating the the v7
cardview project, add the android-support-v7-cardview.jar file to the
build path.
right-click the library project folder and select build path > configure build path.
in the order and export tab, check the .jar files you just added to the
build path, so they are available to projects that depend on this
library project. for example, the cardview project requires you to
export the android-support-v7-cardview.jar file.
uncheck android dependencies.
click ok to complete the changes.
you now have a library project for your selected support library that you can use with one or more application projects.
add the library to your application project:
in the project explorer, right-click your project and select properties.
in the category panel on the left side of the dialog, select android.
in the library pane, click the add button.
select the library project and click ok. for example, the appcompat project should be listed as android-support-v7-cardview.
in the properties window, click ok.
需要注意project.properties里的target尽量高点比较好,如果低了可能会出现类似
no
resource found that matches the given name '@style/theme.appcompat.light'的问题。我选的是23。
全部回答
- 1楼网友:毛毛
- 2021-02-26 00:07
有如下两种方法可以在Android studio中导入appcompat-v7。方法1:在项目的build.gradle文件里,用传统的自动依赖处理方式:
compile ‘com.Android.support:appcompat-v7:+’,然后rebuild就可以了。
方法2:
1、直接在Module上右键Open Module Settings,如下图:
2、选中Modules,打开Dependencies选项卡,点击右边的‘+’号,选第一个Library Dependency,如下图:
3、选中appcompat-v7即可
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯