ImageView.SetAdjustViewBounds(Boolean) Method

Definition

Set this to true if you want the ImageView to adjust its bounds to preserve the aspect ratio of its drawable.

[Android.Runtime.Register("setAdjustViewBounds", "(Z)V", "GetSetAdjustViewBounds_ZHandler")]
public virtual void SetAdjustViewBounds (bool adjustViewBounds);
[<Android.Runtime.Register("setAdjustViewBounds", "(Z)V", "GetSetAdjustViewBounds_ZHandler")>]
abstract member SetAdjustViewBounds : bool -> unit
override this.SetAdjustViewBounds : bool -> unit

Parameters

adjustViewBounds
Boolean

Whether to adjust the bounds of this view to preserve the original aspect ratio of the drawable.

Attributes

Remarks

Set this to true if you want the ImageView to adjust its bounds to preserve the aspect ratio of its drawable.

<strong>Note:</strong> If the application targets API level 17 or lower, adjustViewBounds will allow the drawable to shrink the view bounds, but not grow to fill available measured space in all cases. This is for compatibility with legacy android.view.View.MeasureSpec MeasureSpec and android.widget.RelativeLayout RelativeLayout behavior.

Java documentation for android.widget.ImageView.setAdjustViewBounds(boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also