android.widget.HorizontalScrollView.smoothScrollBy()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中android.widget.HorizontalScrollView.smoothScrollBy()方法的一些代码示例,展示了HorizontalScrollView.smoothScrollBy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HorizontalScrollView.smoothScrollBy()方法的具体详情如下:
包路径:android.widget.HorizontalScrollView
类名称:HorizontalScrollView
方法名:smoothScrollBy

HorizontalScrollView.smoothScrollBy介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

public void autoSmoothScroll() {
   final HorizontalScrollView hsv = (HorizontalScrollView) view.findViewById(R.id.horiscroll);
   hsv.postDelayed(new Runnable() {
     @Override
     public void run() {
       //hsv.fullScroll(HorizontalScrollView.FOCUS_RIGHT);
       hsv.smoothScrollBy(500, 0);
     }
   },100);
 }

代码示例来源:origin: Tencent/RapidView

public void run(RapidParserObject object, Object view, Var value) {
    List<String> list = RapidStringUtils.stringToList(value.getString());
    if( list.size() < 2 ){
      return;
    }
    ((HorizontalScrollView)view).smoothScrollBy(Integer.parseInt(list.get(0)), Integer.parseInt(list.get(1)));
  }
}

代码示例来源:origin: quaap/LaunchTime

private void hscrollOnDrag(View view, DragEvent event, HorizontalScrollView scrollView) {
  float tx = view.getLeft() + event.getX();
  if (isAncestor(scrollView, view)) {
    int thresh = scrollView.getWidth() / 6;
    if (tx < scrollView.getScrollX() + thresh) {
      scrollView.smoothScrollBy(-10, 0);
    } else if (tx > scrollView.getScrollX() + scrollView.getWidth() - thresh) {
      scrollView.smoothScrollBy(10,0);
    }
  }
}

相关文章

HorizontalScrollView类方法