本文整理匯總了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));
}