在2.2下使用GridLayout
16lz
2021-01-26
并不是在项目下面加入android-support-v7-gridlayout.jar正确的使用方法如下:1 在SDK目录下的 \extras\android\support\v7下有 gridlayout 项目,是个library项目, 导入eclipse 稍微调试一下,就不报错了(附件就是)2 在自己的项目上右键-->属性-->android-->library里面添加上面的项目3 按照下面的demo使用就可以啦<android.support.v7.widget.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.widget.GridLayout>
更多相关文章
- android attr.xml 怎么在主工程中设置library项目中背景或者其他
- Android下调试.so库类的bug
- android studio ,gradle 导入项目 常见错误 错误提示:Error:(2, 0)
- [置顶] 第8章android动态调试
- 【翻译】Android(安卓)Support Library
- Android(安卓)studio如何使用SVN进行版本控制?
- cordova + vue-cli构建跨平台应用
- 设置android编码格式与包的引入格式于源码一致
- 2017年Android开源项目及库汇总