Android.Widget.ImageView.SetMaxHeight Method
An optional argument to supply a maximum height for this view.

Syntax

[Android.Runtime.Register("setMaxHeight", "(I)V", "GetSetMaxHeight_IHandler")]
public virtual void SetMaxHeight (int maxHeight)

See Also

ImageView.MaxHeight

Parameters

maxHeight
maximum height for this view

Remarks

An optional argument to supply a maximum height for this view. Only valid if ImageView.SetAdjustViewBounds(bool) has been set to true. To set an image to be a maximum of 100 x 100 while preserving the original aspect ratio, do the following: 1) set adjustViewBounds to true 2) set maxWidth and maxHeight to 100 3) set the height and width layout params to WRAP_CONTENT.

Note that this view could be still smaller than 100 x 100 using this approach if the original image is small. To set an image to a fixed size, specify that size in the layout params and then use ImageView.SetScaleType(.ScaleType) to determine how to fit the image within the bounds.

[Android Documentation]

Requirements

Namespace: Android.Widget
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1