mirror of
https://github.com/zhigang1992/react-native-super-grid.git
synced 2026-01-12 22:50:58 +08:00
modify README
This commit is contained in:
13
README.md
13
README.md
@@ -8,7 +8,7 @@ Responsive Grid View for React Native.
|
||||
|
||||
This component renders a Grid View that adapts itself to various screen resolutions.
|
||||
|
||||
Instead of passing an itemPerRow argument, you pass ```itemWidth``` and each item will be rendered with a width equal to or more than (to fill the screen) the given width.
|
||||
Instead of passing an itemPerRow argument, you pass ```itemDimension``` and each item will be rendered with a dimension size equal to or more than (to fill the screen) the given dimension.
|
||||
|
||||
Internally, this component uses the native [ListView](https://facebook.github.io/react-native/docs/listview.html).
|
||||
|
||||
@@ -30,7 +30,7 @@ import GridView from 'react-native-super-grid';
|
||||
```
|
||||
```
|
||||
<GridView
|
||||
itemWidth={130}
|
||||
itemDimension={130}
|
||||
items={[1,2,3,4,5,6]}
|
||||
renderItem={item => (<Text>{item}</Text>)}
|
||||
/>
|
||||
@@ -42,11 +42,12 @@ import GridView from 'react-native-super-grid';
|
||||
|---|---|---|---|
|
||||
| renderItem | Function | | Function to render each object. Should return a react native component. |
|
||||
| items | Array | | Items to be rendered. renderItem will be called with each item in this array. | |
|
||||
| itemWidth | Number | 120 | Minimum width for each item in pixels (virtual). |
|
||||
| fixed | Boolean | false | If true, the exact ```itemWidth``` will be used and won't be adjusted to fit the screen. |
|
||||
| itemDimension | Number | 120 | Minimum width or height for each item in pixels (virtual). |
|
||||
| fixed | Boolean | false | If true, the exact ```itemDimension``` will be used and won't be adjusted to fit the screen. |
|
||||
| spacing | Number | 10 | Spacing between each item. |
|
||||
| style | [ListView](https://facebook.github.io/react-native/docs/listview.html) styles (Object) | | Styles for the container. Styles for an item should be applied inside ```renderItem```. |
|
||||
| staticWidth | Number | undefined | Specifies a static width for the GridView container. If your container width is known or can be calculated at runtime (via ```Dimensions.get('window')```, for example), passing this prop will force the grid container to that width and avoid the reflow associated with dynamically calculating the container's width |
|
||||
| staticDimension | Number | undefined | Specifies a static width or height for the GridView container. If your container dimension is known or can be calculated at runtime (via ```Dimensions.get('window')```, for example), passing this prop will force the grid container to that dimension size and avoid the reflow associated with dynamically calculating it|
|
||||
| horizontal | boolean | false | If true, the grid will be scrolling horizontally|
|
||||
|
||||
|
||||
|
||||
@@ -74,7 +75,7 @@ export default class Example extends Component {
|
||||
|
||||
return (
|
||||
<GridView
|
||||
itemWidth={130}
|
||||
itemDimension={130}
|
||||
items={items}
|
||||
style={styles.gridView}
|
||||
renderItem={item => (
|
||||
|
||||
Reference in New Issue
Block a user