共用方式為


View.Inflate(Context, Int32, ViewGroup) Method

Definition

Inflate a view from an XML resource.

[Android.Runtime.Register("inflate", "(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;", "")]
public static Android.Views.View? Inflate (Android.Content.Context? context, int resource, Android.Views.ViewGroup? root);
[<Android.Runtime.Register("inflate", "(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;", "")>]
static member Inflate : Android.Content.Context * int * Android.Views.ViewGroup -> Android.Views.View

Parameters

context
Context

The Context object for your activity or application.

resource
Int32

The resource ID to inflate

root
ViewGroup

A view group that will be the parent. Used to properly inflate the layout_* parameters.

Returns

Attributes

Remarks

Inflate a view from an XML resource. This convenience method wraps the LayoutInflater class, which provides a full range of options for view inflation.

Java documentation for android.view.View.inflate(android.content.Context, int, android.view.ViewGroup).

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

See also