Example usage for android.widget ImageView layout

List of usage examples for android.widget ImageView layout

Introduction

In this page you can find the example usage for android.widget ImageView layout.

Prototype

@SuppressWarnings({ "unchecked" })
public void layout(int l, int t, int r, int b) 

Source Link

Document

Assign a size and position to a view and all of its descendants

This is the second phase of the layout mechanism.

Usage

From source file:Main.java

private static void updateImageViewAfterScaleTypeChange(ImageView imageView) {
    // enforcing imageView to update its internal bounds/matrix immediately
    imageView.measure(MeasureSpec.makeMeasureSpec(imageView.getMeasuredWidth(), MeasureSpec.EXACTLY),
            MeasureSpec.makeMeasureSpec(imageView.getMeasuredHeight(), MeasureSpec.EXACTLY));
    imageView.layout(imageView.getLeft(), imageView.getTop(), imageView.getRight(), imageView.getBottom());
}