See Also: ViewStub
public sealed class ViewStub : View
A ViewStub is an invisible, zero-sized View that can be used to lazily inflate layout resources at runtime. When a ViewStub is made visible, or when ViewStub.Inflate is invoked, the layout resource is inflated. The ViewStub then replaces itself in its parent with the inflated View or Views. Therefore, the ViewStub exists in the view hierarchy until ViewStub.setVisibility(int) or ViewStub.Inflate is invoked. The inflated View is added to the ViewStub's parent with the ViewStub's layout parameters. Similarly, you can define/override the inflate View's id by using the ViewStub's inflatedId property. For instance:
<ViewStub android:id="@+id/stub" android:inflatedId="@+id/subTree" android:layout="@layout/mySubTree" android:layout_width="120dip" android:layout_height="40dip" />
ViewStub stub = (ViewStub) findViewById(R.id.stub); View inflated = stub.inflate();
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1
The members of Android.Views.ViewStub are listed below.
See Also: View
|InflatedId||Int32. Returns the id taken by the inflated view.|
|LayoutInflater||LayoutInflater. Get current LayoutInflater used in ViewStub.Inflate.|
|LayoutResource||Int32. Returns the layout resource that will be used by ViewStub.setVisibility(int) or ViewStub.Inflate to replace this StubbedView in its parent by another view.|
Inflates the layout resource identified by ViewStub.LayoutResource and replaces this StubbedView in its parent by the inflated layout resource.
Specifies the inflate listener to be notified after this ViewStub successfully inflated its layout resource.