语言

IAttributeSet 接口

定义

与 XML 文档中的标记关联的属性集合。

[Android.Runtime.Register("android/util/AttributeSet", "", "Android.Util.IAttributeSetInvoker")]
public interface IAttributeSet : Android.Runtime.IJavaObject, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/util/AttributeSet", "", "Android.Util.IAttributeSetInvoker")>]
type IAttributeSet = interface
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
派生
属性
实现

注解

与 XML 文档中的标记关联的属性集合。 通常,你不希望直接使用此接口,而是将它 android.content.res.Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int) Resources.Theme.obtainStyledAttributes() 传递给该接口,以便负责分析属性。 具体而言,资源 API 将转换资源引用(属性值,如“)

Java文档android.util.AttributeSet。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

属性

名称 说明
AttributeCount

返回集中可用的属性数。

ClassAttribute

返回“class”属性的值;如果没有,则返回 null。

Handle

获取基础 Android 对象的 JNI 值。

(继承自 IJavaObject)
IdAttribute

返回“id”属性的值;如果没有,则返回 null。

JniIdentityHashCode

返回包装实例的值 java.lang.System.identityHashCode() 。

(继承自 IJavaPeerable)
JniManagedPeerState

托管对等方的状态。

(继承自 IJavaPeerable)
JniObjectReferenceControlBlock

与 XML 文档中的标记关联的属性集合。

(继承自 IJavaPeerable)
JniPeerMembers

成员访问和调用支持。

(继承自 IJavaPeerable)
PeerReference

返回JniObjectReference包装的Java对象实例。

(继承自 IJavaPeerable)
PositionDescription

返回属性集当前位置的说明。

StyleAttribute

返回“style”属性的值;如果没有,则返回 0。

方法

名称 说明
Disposed()

在释放实例时调用。

(继承自 IJavaPeerable)
DisposeUnlessReferenced()

如果没有对此实例的未完成引用,则调用 Dispose();否则不执行任何操作。

(继承自 IJavaPeerable)
Finalized()

在实例完成时调用。

(继承自 IJavaPeerable)
GetAttributeBooleanValue(Int32, Boolean)

返回“index”处属性的布尔值。

GetAttributeBooleanValue(String, String, Boolean)

返回“attribute”的布尔值。

GetAttributeFloatValue(Int32, Single)

返回“index”处属性的浮点值。

GetAttributeFloatValue(String, String, Single)

返回“attribute”的浮点值。

GetAttributeIntValue(Int32, Int32)

返回“index”处属性的整数值。

GetAttributeIntValue(String, String, Int32)

返回“attribute”的整数值。

GetAttributeListValue(Int32, String[], Int32)

返回列表“options”中属性值“index”的索引。

GetAttributeListValue(String, String, String[], Int32)

返回列表“options”中“attribute”的值的索引。

GetAttributeName(Int32)

返回指定属性的名称。

GetAttributeNameResource(Int32)

返回与给定属性名称关联的资源 ID。

GetAttributeNamespace(Int32)

返回指定属性的命名空间。

GetAttributeResourceValue(Int32, Int32)

将“index”处的属性值作为资源标识符返回。

GetAttributeResourceValue(String, String, Int32)

将“attribute”的值作为资源标识符返回。

GetAttributeUnsignedIntValue(Int32, Int32)

返回设置为无符号值的“index”属性的整数值。

GetAttributeUnsignedIntValue(String, String, Int32)

返回格式化为无符号值的“attribute”的布尔值。

GetAttributeValue(Int32)

以字符串表示形式返回指定特性的值。

GetAttributeValue(String, String)

以字符串表示形式返回指定特性的值。

GetIdAttributeResourceValue(Int32)

如果没有,则返回“id”属性或 defaultValue 的整数值。

SetJniIdentityHashCode(Int32)

设置由 JniIdentityHashCode. 返回的值。

(继承自 IJavaPeerable)
SetJniManagedPeerState(JniManagedPeerStates)

与 XML 文档中的标记关联的属性集合。

(继承自 IJavaPeerable)
SetPeerReference(JniObjectReference)

设置由 PeerReference. 返回的值。

(继承自 IJavaPeerable)
UnregisterFromRuntime()

取消注册此实例,使运行时不会从将来 Java.Interop.JniRuntime+JniValueManager.PeekValue 的调用中返回它。

(继承自 IJavaPeerable)

扩展方法

名称 说明
GetJniTypeName(IJavaPeerable)

获取实例 self类型的 JNI 名称。

JavaAs<TResult>(IJavaPeerable)

尝试强制self键入TResult,检查强制是否在Java端有效。

JavaCast<TResult>(IJavaObject)

执行 Android 运行时检查的类型转换。

JavaCast<TResult>(IJavaObject)

与 XML 文档中的标记关联的属性集合。

TryJavaCast<TResult>(IJavaPeerable, TResult)

尝试强制self键入TResult,检查强制是否在Java端有效。

适用于