12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- /**
- * @param:
- * width: 每一个item宽度
- * height: 每一个item高度
- * data: 数据 Arrary
- */
- import React, { Component } from "react";
- import {
- StyleSheet,
- Text,
- View,
- } from "react-native";
- import Dimensions from '../utils/dimensions'
- const styles = StyleSheet.create({
- })
- export default class ScrollRow extends Component {
-
- render() {
- return (
- <FlatList
- data={[{ title: 'Title Text', key: 'item1' }]}
- horizontal={true}
- renderItem={({ item, separators }) => (
- <TouchableOpacity
- style={{
- flex: 1,
- height: "100%",
- width: this.getWindowWidth() * 0.9
- }}
- onPress={() => {
- alert(item.name);
- }}
- activeOpacity={1}
- >
- <Image
- source={{
- uri: item.icon
- }}
- style={{
- height: "100%",
- width: "100%",
- justifyContent: "center",
- alignItems: "center",
- borderRadius: 20
- }}
- />
- </TouchableOpacity>
- )}
- />
- )
- }
- }
|