我正在使用scrollview,并希望检测用户何时结束拖动事件.我为onScrollEndDrag放了一个console.log,它没有给出任何控制台输出,即没有检测到onScrollEndDrag.有没有办法解决这个问题?
请看下面的代码.
var Main = React.createClass({
getInitialState: function() {
return {
LoadedPageState: false,
menuJson: [],
pageToLoad: "landingPage",
mainlogopic: 'mainlogo',
profilepic: 'profile',
notificationpic: 'notification',
bagpic: 'bag',
morepic: 'more',
moveend: 0,
count: 1,
frmDrag: false,
}
},
horScrollViewInstance: {
scrollTo: () => {}
},
control: {
onscroll: () => {}
},
touchStart: {
ontouchstart: () => {}
},
componentWillMount: function() {
var menuJson = require('./data/data.json');
this.setState({
menuJson: menuJson
});
},
currentPageAction: function(pageToLoad) {
this.setState({
LoadedPageState: true,
pageToLoad: pageToLoad
});
},
currentPageBackAction: function() …Run Code Online (Sandbox Code Playgroud) 我尝试在滚动视图中使用 onResponderTerminationRequest={()=> false}, onStartShouldSetResponderCapture={()=> false} ,以便它始终拥有控制权。但发生的情况是它释放了控件并将其传递给其他滚动。