本文整理了Java中android.widget.ScrollView.getTop()
方法的一些代码示例,展示了ScrollView.getTop()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ScrollView.getTop()
方法的具体详情如下:
包路径:android.widget.ScrollView
类名称:ScrollView
方法名:getTop
暂无
代码示例来源:origin: AmazMod/AmazMod
public void run() {
Log.d(Constants.TAG, "WearAppsFragment onActivityResult scrollToTop");
//scrollView.fullScroll(scrollView.FOCUS_UP);
scrollView.scrollTo(0, scrollView.getTop());
}
});
代码示例来源:origin: stackoverflow.com
ScrollView s = (ScrollView) findViewById(R.id.yourid);
s.scrollTo(0,s.getTop());
代码示例来源:origin: stackoverflow.com
public static boolean isInVisible(ScrollView scrollView, View view, Rect region, boolean relative)
{
int top = scrollView.getScrollY() + region.top;
int bottom = scrollView.getScrollY() + region.bottom;
if(!relative)
{
// If given region is not relative to scrollView
// i.e 0,0 does not point to first child left and top
top -= scrollView.getTop();
bottom -= scrollView.getTop();
}
Rect rect = new Rect(region);
rect.top = top;
rect.bottom = bottom;
Rect childRegion = new Rect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
return Rect.intersects(childRegion, region);
}
代码示例来源:origin: stackoverflow.com
.getChildAt(mScrollView.getChildCount() - 1);
final int sVH = mScrollView.getBottom()
- mScrollView.getTop();
代码示例来源:origin: derry/delion
/**
* Updates the animation.
*
* @param progress How far along the animation is. In the range [0,1], with 1 being done.
*/
private void update(float progress) {
// The dialog container initially starts off translated downward, gradually decreasing
// the translation until it is in the right place on screen.
float containerTranslation = mContainerHeightDifference * progress;
mRequestView.setTranslationY(containerTranslation);
if (mIsButtonBarLockedInPlace) {
// The button bar is translated along the dialog so that is looks like it stays in
// place at the bottom while the entire bottom sheet is translating upwards.
mButtonBar.setTranslationY(-containerTranslation);
// The payment container is sandwiched between the header and the button bar.
// Expansion animates by changing where its "bottom" is, letting its shadows appear
// and disappear as it changes size.
int paymentContainerBottom = Math.min(
mPaymentContainer.getTop() + mPaymentContainer.getMeasuredHeight(),
mButtonBar.getTop());
mPaymentContainer.setBottom(paymentContainerBottom);
}
}
内容来源于网络,如有侵权,请联系作者删除!