android.widget.ScrollView.setOverScrollMode()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(198)

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

ScrollView.setOverScrollMode介绍

暂无

代码示例

代码示例来源:origin: ZieIony/Carbon

@Override
public void setOverScrollMode(int mode) {
  if (mode != OVER_SCROLL_NEVER) {
    if (topGlow == null) {
      Context context = getContext();
      topGlow = new EdgeEffect(context);
      bottomGlow = new EdgeEffect(context);
      updateTint();
    }
  } else {
    topGlow = null;
    bottomGlow = null;
  }
  super.setOverScrollMode(OVER_SCROLL_NEVER);
  this.overscrollMode = mode;
}

代码示例来源:origin: baiyuliang/QRobot

/**
 * 防止滑动Scrollview到顶部或底部时出现蓝边现象
 *
 * @param scrollView
 */
public static void setOverScrollMode(ScrollView scrollView) {
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO)
    scrollView.setOverScrollMode(View.OVER_SCROLL_NEVER);
}

代码示例来源:origin: hefuyicoder/ZhihuDaily

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  super.onViewCreated(view, savedInstanceState);
  ButterKnife.bind(this, view);
  //去除滑动到底部的蓝色阴影
  scrollView.setOverScrollMode(ScrollView.OVER_SCROLL_NEVER);
  if (isWebViewOK()) {
    llWebViewContainer.addView(mWebViewSoftReference.get());
  }
}

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

public void run(RapidParserObject object, Object view, Var value) {
    ((ScrollView)view).setOverScrollMode(value.getInt());
  }
}

代码示例来源:origin: jelic98/dynamico

@Override
  public View style(View view, JSONObject attributes) throws Exception {
    super.style(view, attributes);

    ScrollView scrollView = (ScrollView) view;

    if(attributes.has("fillViewport")) {
      scrollView.setFillViewport(attributes.getBoolean("fillViewport"));
    }

    if(attributes.has("smoothScrollingEnabled")) {
      scrollView.setSmoothScrollingEnabled(attributes.getBoolean("smoothScrollingEnabled"));
    }

    if(attributes.has("overScrollMode")) {
      String mode = attributes.getString("overScrollMode");

      if(mode.equalsIgnoreCase("always")) {
        scrollView.setOverScrollMode(ScrollView.OVER_SCROLL_ALWAYS);
      }else if(mode.equalsIgnoreCase("never")) {
        scrollView.setOverScrollMode(ScrollView.OVER_SCROLL_NEVER);
      }else if(mode.equalsIgnoreCase("if_content_scrolls")) {
        scrollView.setOverScrollMode(ScrollView.OVER_SCROLL_IF_CONTENT_SCROLLS);
      }
    }

    return scrollView;
  }
}

代码示例来源:origin: AriesHoo/UIWidget

private void createContainerView() {
  mLLayoutContainer = new LinearLayout(mContext);
  mLLayoutContainer.setId(R.id.lLayout_containerAlertDialog);
  mLLayoutContainer.setLayoutParams(new LinearLayout.LayoutParams(
      ViewGroup.LayoutParams.MATCH_PARENT, 0, 1.0f));
  mLLayoutContainer.setOrientation(LinearLayout.VERTICAL);
  mLLayoutContainer.setPadding(mPadding, dp2px(12), mPadding, dp2px(12));
  mLLayoutContainer.setGravity(mCenterGravity);
  mLLayoutRoot.addView(mLLayoutContainer);
  mLLayoutView = new LinearLayout(mContext);
  mLLayoutContainer.setId(R.id.lLayout_ViewAlertDialog);
  mLLayoutView.setOrientation(LinearLayout.VERTICAL);
  mLLayoutView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
  mSvView = new ScrollView(mContext);
  mSvView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
  mSvView.setOverScrollMode(View.OVER_SCROLL_NEVER);
  mSvView.setVerticalScrollBarEnabled(false);
  mSvView.addView(mLLayoutView);
  mLLayoutContainer.addView(mSvView);
  if (mListViews != null) {
    for (View v : mListViews) {
      mLLayoutView.addView(v);
    }
  }
}

相关文章

ScrollView类方法