在2.2下使用GridLayout 及GridLayout包下载
来源:互联网 发布:陕西省家长网络学校 编辑:程序博客网 时间:2024/06/10 15:29
并不是在项目下面加入android-support-v7-gridlayout.jar
正确的使用方法如下:
在使用gridlayout中遇到
1 在SDK目录下的 \extras\android\support\v7下有 gridlayout 项目,是个library项目, 导入eclipse 稍微调试一下,就不报错了(附件就是)
2 在自己的项目上右键-->属性-->android-->library里面添加上面的项目
3 按照下面的demo使用就可以啦
<android.support.v7.gridlayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.example.androidtest"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:alignmentMode="alignBounds"
app:columnCount="3"
app:columnOrderPreserved="false"
app:rowCount="5"
app:useDefaultMargins="true" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
app:layout_rowSpan="2"
android:text="@string/hello_world" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
app:layout_rowSpan="1"
android:text="@string/hello_world" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
app:layout_rowSpan="3"
android:text="@string/hello_world" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
app:layout_rowSpan="1"
android:text="@string/hello_world" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
app:layout_rowSpan="1"
android:text="@string/hello_world" />
正确的使用方法如下:
在使用gridlayout中遇到
Caused by: java.lang.NoClassDefFoundError: android.support.v7.gridlayout.R$dimen
问题,网上很多人碰到,但是也没有找到解决方法。
无意中解决了该问题,特记录。
1.libs文件夹中添加android-support-v7-gridlayout.jar包;
2.eclipse中将android-sdk-windows\extras\android\compatibility\v7\gridlayout工程导入,并添加到需要使用gridlayout工程中,作为lib project处理
上面2个步骤缺一不可。
一开始只有上面的2个之一,一直报异常。
1 在SDK目录下的 \extras\android\support\v7下有 gridlayout 项目,是个library项目, 导入eclipse 稍微调试一下,就不报错了(附件就是)
2 在自己的项目上右键-->属性-->android-->library里面添加上面的项目
3 按照下面的demo使用就可以啦
<android.support.v7.gridlayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.example.androidtest"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:alignmentMode="alignBounds"
app:columnCount="3"
app:columnOrderPreserved="false"
app:rowCount="5"
app:useDefaultMargins="true" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
app:layout_rowSpan="2"
android:text="@string/hello_world" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
app:layout_rowSpan="1"
android:text="@string/hello_world" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
app:layout_rowSpan="3"
android:text="@string/hello_world" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
app:layout_rowSpan="1"
android:text="@string/hello_world" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
app:layout_rowSpan="1"
android:text="@string/hello_world" />
</android.support.v7.gridlayout>
下载:http://download.csdn.net/detail/irizhao/7691747
0 0
- 在2.2下使用GridLayout 及GridLayout包下载
- 在2.2下使用GridLayout
- GridLayout
- GridLayout
- gridlayout
- GridLayout
- GridLayout
- GridLayout
- gridlayout
- GridLayout
- GridLayout
- gridlayout
- GridLayout
- GridLayout
- GridLayout
- GridLayout
- GridLayout
- GridLayout
- ffmpeg 分离音频 保存
- 6174问题
- hdoj.1021 Fibonacci Again 20140725
- SEO基础知识之权重标签解说
- android从网络获取图片以及异步加载图片
- 在2.2下使用GridLayout 及GridLayout包下载
- Struts2全局结果,action链及动态结果的应用
- hmm
- 欧拉函数
- iOS开发-将自己的app在appstore下架的方法
- 【线性扫描i】 valid number 数字格式是否正确
- Cocos2d-x 3.2 Lua示例 ActionTest(动作测试)
- 自然数拆分
- hdu 4888 2014多校第三场1002 Redraw Beautiful Drawings 网络流