我正在制作一个React原生应用程序,场景如下:
我已经阅读了PanResponder
和Animated
API的文档(多次),但找不到任何实现这一点的东西,也找不到其他实现类似功能的人.
在panresponder事件中的约束?
onPanResponderMove: Animated.event([null,{
dx: this.state.pan.x, //Some function here to constrain the value?
dy: this.state.pan.y
}]),
在应用变换时进行约束?
style = {
transform: {
transformX: ...,//Use interpolate to constrain the values somehow?
transformY: ...
}
}