本文整理汇总了Java中android.support.v4.view.ViewCompat.setY方法的典型用法代码示例。如果您正苦于以下问题:Java ViewCompat.setY方法的具体用法?Java ViewCompat.setY怎么用?Java ViewCompat.setY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.view.ViewCompat
的用法示例。
在下文中一共展示了ViewCompat.setY方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setY
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
public static void setY(final @NonNull View v, final int y) {
if (VERSION.SDK_INT >= 11) {
ViewCompat.setY(v, y);
} else {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams)v.getLayoutParams();
params.topMargin = y;
v.setLayoutParams(params);
}
}
示例2: onItemViewHeightChanged
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
void onItemViewHeightChanged(int newHeight) {
if ((prevHeight != 0) && (newHeight != prevHeight)) {
final View view = getInnerLayout();
ViewCompat.setY(view, ViewCompat.getY(view) - (prevHeight - newHeight));
}
prevHeight = newHeight;
}
示例3: updateMaxValue
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private static void updateMaxValue(final View targetView,
final float startScaleX, final float startScaleY,
final Point startPoint,
final Point endPoint,
float fraction) {
ViewCompat.setScaleX(targetView, startScaleX + (1 - startScaleX) * fraction);
ViewCompat.setScaleY(targetView, startScaleY + (1 - startScaleY) * fraction);
ViewCompat.setX(targetView, (startPoint.x + (endPoint.x - startPoint.x) * fraction) - targetView.getMeasuredWidth() / 2);
ViewCompat.setY(targetView, (startPoint.y + (endPoint.y - startPoint.y) * fraction) - targetView.getMeasuredHeight() / 2);
}
示例4: resetInnerLayoutOffset
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
void resetInnerLayoutOffset() {
ViewCompat.setY(getInnerLayout(), 0);
}