本文整理汇总了Java中android.view.View.setTop方法的典型用法代码示例。如果您正苦于以下问题:Java View.setTop方法的具体用法?Java View.setTop怎么用?Java View.setTop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.setTop方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyTransformation
import android.view.View; //导入方法依赖的package包/类
private void applyTransformation() {
for (int i = 0, cnt = getChildCount(); i < cnt; i++) {
final View view = getChildAt(i);
final int viewHeight = view.getMeasuredHeight();
if (view.getBottom() > 0) {
final int viewBottom = view.getBottom();
if (viewBottom - viewHeight < 0) {
view.setTop(0);
} else {
view.setTop(viewBottom - viewHeight);
}
final int viewNewHeight = viewBottom - view.getTop();
((InnerItem) mRecyclerView.getChildViewHolder(view)).onItemViewHeightChanged(viewNewHeight);
}
if (view.getTop() > 0) {
((InnerItem) mRecyclerView.getChildViewHolder(view)).resetInnerLayoutOffset();
}
}
}
示例2: set
import android.view.View; //导入方法依赖的package包/类
@Override
public void set(View view, Integer top) {
view.setTop(top);
}
示例3: getBoundsAnimator
import android.view.View; //导入方法依赖的package包/类
/**
* Returns an animator that animates the bounds of a single view.
*/
public static Animator getBoundsAnimator(View view, int fromLeft, int fromTop, int fromRight,
int fromBottom, int toLeft, int toTop, int toRight, int toBottom) {
view.setLeft(fromLeft);
view.setTop(fromTop);
view.setRight(fromRight);
view.setBottom(fromBottom);
return ObjectAnimator.ofPropertyValuesHolder(view,
PropertyValuesHolder.ofInt(VIEW_LEFT, toLeft),
PropertyValuesHolder.ofInt(VIEW_TOP, toTop),
PropertyValuesHolder.ofInt(VIEW_RIGHT, toRight),
PropertyValuesHolder.ofInt(VIEW_BOTTOM, toBottom));
}