我正在使用 React Native 库开发 FotoBook 应用程序。当我让用户从设备库中选择图像后,我将它们以水平模式放入 FlatList 组件中。那么如何将选定的图像拖放到屏幕的其他部分
我正在使用 PanResponder 和 Animated API,它可以很好地转换响应者坐标,但是当我尝试超出水平 FlatList 的范围时,它会被隐藏。我尝试将溢出设置为可见并更改 zIndex 但它不起作用
import React from 'react';
import {
SafeAreaView,
View,
FlatList,
Text,
StyleSheet,
Animated,
PanResponder
} from 'react-native';
import { v4 } from 'uuid';
export default class App extends React.PureComponent{
state = {
data: [
{ id: v4(), title: 'Lightcoral', hex: '#eb7474' },
{ id: v4(), title: 'Orchid', hex: '#eb74dc' },
{ id: v4(), title: 'Mediumpurple', hex: '#9a74eb' },
{ id: v4(), title: …Run Code Online (Sandbox Code Playgroud)