小编ras*_*han的帖子

如何在React-Native Android中检测拖动事件的结束

我正在使用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)

scrollview react-native

13
推荐指数
2
解决办法
1万
查看次数

反应本机 onResponderTerminationRequest={()=> false},onStartShouldSetResponderCapture={()=> false} 不起作用

我尝试在滚动视图中使用 onResponderTerminationRequest={()=> false}, onStartShouldSetResponderCapture={()=> false} ,以便它始终拥有控制权。但发生的情况是它释放了控件并将其传递给其他滚动。

scrollview gesture react-native

5
推荐指数
0
解决办法
1541
查看次数

标签 统计

react-native ×2

scrollview ×2

gesture ×1