Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/byteszero/gridviewdemo
GridViewDemo
https://github.com/byteszero/gridviewdemo
Last synced: 4 days ago
JSON representation
GridViewDemo
- Host: GitHub
- URL: https://github.com/byteszero/gridviewdemo
- Owner: BytesZero
- License: epl-1.0
- Created: 2015-02-11T04:06:12.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-13T04:11:14.000Z (almost 10 years ago)
- Last Synced: 2023-11-05T13:22:15.322Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 1.61 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GridViewDemo
####xml文件
```java```
***
```java
android:numColumns="auto_fit" //设置GridView的列数,这里可以设置数字1、2、3、...或者设置它自适应auto_fit
```
```java
android:horizontalSpacing="@dimen/item_margin" //设置每个item之间左右的间距
android:verticalSpacing="@dimen/item_margin" //设置每个item之间上下的间距
```
***
####java文件
```java
GridView gv_tuijian = (GridView) findViewById(R.id.main_gv_tuijian);
gv_tuijian.setAdapter(main_adapter);
```
***
```java
其中main_adapter和listview的adapter的没有什么区别
```
***
####效果图
![效果图](https://github.com/yy1300326388/GridViewDemo/blob/master/demo_img.png)