次の方法で共有


Context.GetColor(Int32) Method

Definition

Returns a color associated with a particular resource ID and styled for the current theme.

[Android.Runtime.Register("getColor", "(I)I", "", ApiSince=23)]
public int GetColor (int id);
[<Android.Runtime.Register("getColor", "(I)I", "", ApiSince=23)>]
member this.GetColor : int -> int

Parameters

id
Int32

The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier.

Returns

A single color value in the form 0xAARRGGBB.

Attributes

Remarks

Returns a color associated with a particular resource ID and styled for the current theme.

Java documentation for android.content.Context.getColor(int).

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