다음을 통해 공유


TypedArray Class

Definition

Container for an array of values that were retrieved with Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int) or Resources#obtainAttributes.

[Android.Runtime.Register("android/content/res/TypedArray", DoNotGenerateAcw=true)]
public class TypedArray : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.Lang.IAutoCloseable
[<Android.Runtime.Register("android/content/res/TypedArray", DoNotGenerateAcw=true)>]
type TypedArray = class
    inherit Object
    interface IAutoCloseable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
TypedArray
Attributes
Implements

Remarks

Container for an array of values that were retrieved with Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int) or Resources#obtainAttributes. Be sure to call #recycle when done with them.

The indices used to retrieve values from this structure correspond to the positions of the attributes given to obtainStyledAttributes.

Java documentation for android.content.res.TypedArray.

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.

Constructors

TypedArray(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

ChangingConfigurations

Return a mask of the configuration parameters for which the values in this typed array may change.

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
IndexCount

Returns the number of indices in the array that actually have data.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
PositionDescription

Returns a message about the parser state suitable for printing error messages.

Resources

Returns the Resources object this array was loaded from.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Close()

Recycles the TypedArray, to be re-used by a later caller.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetBoolean(Int32, Boolean)

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

GetColor(Int32, Int32)

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

GetColorStateList(Int32)

Retrieve the ColorStateList for the attribute at <var>index</var>.

GetDimension(Int32, Single)

Retrieve a dimensional unit attribute at <var>index</var>.

GetDimensionPixelOffset(Int32, Int32)

Retrieve a dimensional unit attribute at <var>index</var> for use as an offset in raw pixels.

GetDimensionPixelSize(Int32, Int32)

Retrieve a dimensional unit attribute at <var>index</var> for use as a size in raw pixels.

GetDrawable(Int32)

Retrieve the Drawable for the attribute at <var>index</var>.

GetFloat(Int32, Single)

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

GetFont(Int32)

Retrieve the Typeface for the attribute at <var>index</var>.

GetFraction(Int32, Int32, Int32, Single)

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

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetIndex(Int32)

Returns an index in the array that has data.

GetInt(Int32, Int32)

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

GetInteger(Int32, Int32)

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

GetLayoutDimension(Int32, Int32)

Special version of #getDimensionPixelSize for retrieving android.view.ViewGroup's layout_width and layout_height attributes.

GetLayoutDimension(Int32, String)

Special version of #getDimensionPixelSize for retrieving android.view.ViewGroup's layout_width and layout_height attributes.

GetNonResourceString(Int32)

Retrieves the string value for the attribute at <var>index</var>, but only if that string comes from an immediate value in an XML file.

GetResourceId(Int32, Int32)

Retrieves the resource identifier for the attribute at <var>index</var>.

GetSourceResourceId(Int32, Int32)

Returns the resource ID of the style or layout against which the specified attribute was resolved, otherwise returns defValue.

GetString(Int32)

Retrieves the string value for the attribute at <var>index</var>.

GetText(Int32)

Retrieves the styled string value for the attribute at <var>index</var>.

GetTextArray(Int32)

Retrieve the CharSequence[] for the attribute at <var>index</var>.

GetTextArrayFormatted(Int32)

Retrieve the CharSequence[] for the attribute at <var>index</var>.

GetTextFormatted(Int32)

Retrieves the styled string value for the attribute at <var>index</var>.

GetType(Int32)

Returns the type of attribute at the specified index.

GetValue(Int32, TypedValue)

Retrieve the raw TypedValue for the attribute at <var>index</var>.

HasValue(Int32)

Determines whether there is an attribute at <var>index</var>.

HasValueOrEmpty(Int32)

Determines whether there is an attribute at <var>index</var>, returning true if the attribute was explicitly set to @empty and false only if the attribute was undefined.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Length()

Returns the number of values in this array.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
PeekValue(Int32)

Retrieve the raw TypedValue for the attribute at <var>index</var> and return a temporary object holding its data.

Recycle()

Recycles the TypedArray, to be re-used by a later caller.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to