如何添加android.support.v7.widget.GridLayout到intelliJidea? [英] How to add android.support.v7.widget.GridLayout into intelliJidea?
问题描述
我要添加网格布局到我的Android项目,这是使用支持库GridLayout的V7。我发现<一href="http://stackoverflow.com/questions/12468606/intellij-and-android-support-v7-widget-gridlayout/12477911#12477911">this线程,但也许一些步骤加入该库中并没有提及这一段设置支持网格布局中的IntelliJ库
I want to add GridLayout into my android project which is use support library GridLayout v7. I found this thread but maybe a few steps of adding this library did not mention in this paragraph Set up support GridLayout library in IntelliJ.
谁能解释明显?
编辑: 我在这线程
推荐答案
这是迟到了一个答案,但在这里它是,至少在未来的人们寻找一个解决方案的如何添加支持库和资源< $ C C>网格布局 (或 ActionBarActivity
/ AppCompat
,见$下文)。
It's late for an answer but here it is, at least for future people looking for a solution on how to add the support library and resources for GridLayout
(or ActionBarActivity
/ AppCompat
, see below).
最简单的方法如下:
-
请确保你已经安装了 Android的支持库,从Android SDK管理器。
Make sure you have installed the Android Support Library, from the Android SDK Manager.
在IDEA:打开你的项目,然后选择文件
/ 导入模块
In IDEA: Open your project, then select File
/ Import Module
- 选择SDK目录下:
{SDK} \演员\机器人\ SUPPORT \ V7 \网格布局
- 从外部模型选择
导入模块
和的Eclipse
- 您可以选择
创建模块文件不久的classpath文件
,或者选择把它们放在别的地方,如果你不能/不想写入你的SDK路径 - 在下一屏幕,您将看到
选择Eclipse项目导入
和Android的支持-V7-网格布局
, IDEA也将要求您重新加载项目。 - 这应该在你的项目中添加一个模块
网格布局[Android的支持-V7-网格布局]
。
- select the directory under the SDK:
{SDK}\extras\android\support\v7\gridlayout
- select
Import module from external model
andEclipse
- you can then select
Create module files near .classpath files
, or choose to put them elsewhere if you can't / don't want to write into your SDK path - in the next screen you should see
Select Eclipse projects to import
andandroid-support-v7-gridlayout
, IDEA will also ask you to reload the project. - this should add a module
gridlayout [android-support-v7-gridlayout]
in your project.
现在你需要更新你的项目依赖本模块的资源,并添加的.jar库。选择文件
/ 项目结构
Now you have to update your project dependencies to this module for the resources, and add the .jar libraries. Select File
/ Project Structure
- 选择
模块
项目设置,并选择您的项目(在下面的图片, testv7 ) - 选择
依赖
在右侧面板中 - 与
+
按钮来添加(在右侧面板)一个模块的依赖...
到Android的支持-V7-网格布局
- 同样,添加
罐或目录...
指向{SDK} \演员\机器人\ SUPPORT \ V7 \网格布局\库
目录(或在该.jar)。 如果您打算使用V4为好,选择{SDK} \演员\机器人\ SUPPORT \ V7 \ appcompat \库
,而不是因为它包含V4和V7罐的 - 您的设置应该是这样的:
- select the
Modules
project settings, and select your project (in the picture below, testv7) - select the
Dependencies
on the right panel - add with the
+
button (on the right panel) aModule dependency...
to theandroid-support-v7-gridlayout
- similarly, add a
Jars or directories...
pointing to the{SDK}\extras\android\support\v7\gridlayout\libs
directory (or to the .jar within). If you intend to use the v4 as well, choose{SDK}\extras\android\support\v7\appcompat\libs
instead since it contains both v4 and v7 jars - your settings should look like this:
现在,你应该罚款。
对于我来说这是唯一的出路了类似问题的 ActionBarActivity
,这是使用在相同的技术解决了 {SDK} \演员\机器人\ SUPPORT \ V7 \ appcompat
模块。而且我也尝试了一些其他的方式;)
For me it was the only way out of the similar problem with the ActionBarActivity
, which is solved using the same technique on the {SDK}\extras\android\support\v7\appcompat
module. And I did try a few other ways ;)
这篇关于如何添加android.support.v7.widget.GridLayout到intelliJidea?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!