【问题标题】:Android scrollview: scroll down automatically over a period of time [closed]Android scrollview:在一段时间内自动向下滚动[关闭]
【发布时间】:2015-12-30 11:09:33
【问题描述】:

我目前正在开发一个应用程序,这个应用程序:http://90kids.com/level-dash/,我不知道如何让我的屏幕像那里一样自动滚动。任何帮助表示赞赏

【问题讨论】:

    标签: android xml scrollview game-physics autoscroll


    【解决方案1】:

    创建计时器任务在每个特定时间后滚动您的视图。 参考下面的例子

    Timer timer = new Timer();
                TimerTask doAsynchronousTask = new TimerTask() {       
                    @Override
                    public void run() {
                        handler.post(new Runnable() {
                            public void run() {       
                ScrollView sv =(ScrollView)findViewById(R.id.scrl);
                sv.scrollTo(0, 10);
                            }
                        });
                    }
                };
                timer.schedule(doAsynchronousTask, 0, 100000);
    

    【讨论】:

      猜你喜欢
      • 2013-10-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多