Bagikan melalui


TypedArray.GetFloat(Int32, Single) Method

Definition

Retrieve the float value for the attribute at <var>index</var>.

[Android.Runtime.Register("getFloat", "(IF)F", "GetGetFloat_IFHandler")]
public virtual float GetFloat (int index, float defValue);
[<Android.Runtime.Register("getFloat", "(IF)F", "GetGetFloat_IFHandler")>]
abstract member GetFloat : int * single -> single
override this.GetFloat : int * single -> single

Parameters

index
Int32

Index of attribute to retrieve.

defValue
Single

Returns

Attribute float value, or defValue if the attribute was not defined or could not be coerced to a float.

Attributes

Exceptions

if the TypedArray has already been recycled.

Remarks

Retrieve the float value for the attribute at <var>index</var>.

If the attribute is not a float or an integer, this method will attempt to coerce it to a float using Float#parseFloat(String).

Java documentation for android.content.res.TypedArray.getFloat(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