Udostępnij za pośrednictwem


TypedArray.GetFraction(Int32, Int32, Int32, Single) Method

Definition

Retrieves a fractional unit attribute at <var>index</var>.

[Android.Runtime.Register("getFraction", "(IIIF)F", "GetGetFraction_IIIFHandler")]
public virtual float GetFraction (int index, int base, int pbase, float defValue);
[<Android.Runtime.Register("getFraction", "(IIIF)F", "GetGetFraction_IIIFHandler")>]
abstract member GetFraction : int * int * int * single -> single
override this.GetFraction : int * int * int * single -> single

Parameters

index
Int32

Index of attribute to retrieve.

base
Int32

The base value of this fraction. In other words, a standard fraction is multiplied by this value.

pbase
Int32

The parent base value of this fraction. In other words, a parent fraction (nn%p) is multiplied by this value.

defValue
Single

Value to return if the attribute is not defined or not a resource.

Returns

Attribute fractional value multiplied by the appropriate base value, or defValue if not defined.

Attributes

Exceptions

if the TypedArray has already been recycled.

if the attribute is defined but is not a fraction.

Remarks

Retrieves a fractional unit attribute at <var>index</var>.

Java documentation for android.content.res.TypedArray.getFraction(int, int, int, float).

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