这是我的代码:
componentWillMount() {
this._panResponder = PanResponder.create({
onStartShouldSetPanResponder: (e,gs) => true,
onStartShouldSetPanResponderCapture: (e,gs) => true,
onMoveShouldSetPanResponder: (e,gs) => true,
onMoveShouldSetPanResponderCapture: (e,gs) => true,
onPanResponderMove: (e,gs) => {
let xOrigin = this.props.xCenter - (this.props.dialRadius + this.props.btnRadius + 50);
let yOrigin = this.props.yCenter - (this.props.dialRadius + this.props.btnRadius + 50);
let a = this.cartesianToPolar(gs.moveX-xOrigin, gs.moveY-yOrigin);
this.setState({angle: a});
},
onPanResponderTerminate: (evt, gestureState) => {
console.log("test")
},
});
}
我为不同的SVG对象调用PanResponder
。
我想知道哪些对象称为onPanResponderTerminate
函数。
<G x={endCoord.x-widthHeight} y={endCoord.y-widthHeight}>
<Circle
r={widthHeight}
cx={widthHeight}
cy={widthHeight}
fill={this.props.meterColor}
{...this._panResponder.panHandlers}/>
</G>
<G x={endCoord.x-widthHeight} y={endCoord.y-widthHeight}>
<Circle
r={widthHeight}
cx={widthHeight}
cy={widthHeight}
fill={this.props.meterColor}
{...this._panResponder.panHandlers}/>
</G>