다음을 통해 공유


Resources.Theme.ApplyStyle(Int32, Boolean) Method

Definition

Place new attribute values into the theme.

[Android.Runtime.Register("applyStyle", "(IZ)V", "")]
public void ApplyStyle (int resId, bool force);
[<Android.Runtime.Register("applyStyle", "(IZ)V", "")>]
member this.ApplyStyle : int * bool -> unit

Parameters

resId
Int32

The resource ID of a style resource from which to obtain attribute values.

force
Boolean

If true, values in the style resource will always be used in the theme; otherwise, they will only be used if not already defined in the theme.

Attributes

Remarks

Place new attribute values into the theme. The style resource specified by <var>resid</var> will be retrieved from this Theme's resources, its values placed into the Theme object.

The semantics of this function depends on the <var>force</var> argument: If false, only values that are not already defined in the theme will be copied from the system resource; otherwise, if any of the style's attributes are already defined in the theme, the current values in the theme will be overwritten.

Java documentation for android.content.res.Resources.Theme.applyStyle(int, boolean).

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