Android.InputMethodServices.KeyboardView.OnMeasure Method

Syntax

[Android.Runtime.Register("onMeasure", "(II)V", "GetOnMeasure_IIHandler")]
public virtual void OnMeasure (int widthMeasureSpec, int heightMeasureSpec)

Parameters

widthMeasureSpec
horizontal space requirements as imposed by the parent. The requirements are encoded with NoType:android/view/View$MeasureSpec;Href=../../../reference/android/view/View.MeasureSpec.html.
heightMeasureSpec
vertical space requirements as imposed by the parent. The requirements are encoded with NoType:android/view/View$MeasureSpec;Href=../../../reference/android/view/View.MeasureSpec.html.

Remarks

Measure the view and its content to determine the measured width and the measured height. This method is invoked by Android.Views.View.Measure(int, System.Int32) and should be overriden by subclasses to provide accurate and efficient measurement of their contents.

CONTRACT: When overriding this method, you must call Android.Views.View.SetMeasuredDimension(int, System.Int32) to store the measured width and height of this view. Failure to do so will trigger an IllegalStateException, thrown by Android.Views.View.Measure(int, System.Int32). Calling the superclass' Android.Views.View.OnMeasure(int, System.Int32) is a valid use.

The base class implementation of measure defaults to the background size, unless a larger size is allowed by the MeasureSpec. Subclasses should override Android.Views.View.OnMeasure(int, System.Int32) to provide better measurements of their content.

If this method is overridden, it is the subclass's responsibility to make sure the measured height and width are at least the view's minimum height and width (Android.Views.View.SuggestedMinimumHeight and Android.Views.View.SuggestedMinimumWidth).

[Android Documentation]

Requirements

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