Aracılığıyla paylaş


View.Layout(Int32, Int32, Int32, Int32) Method

Definition

Assign a size and position to a view and all of its descendants

[Android.Runtime.Register("layout", "(IIII)V", "GetLayout_IIIIHandler")]
public virtual void Layout (int l, int t, int r, int b);
[<Android.Runtime.Register("layout", "(IIII)V", "GetLayout_IIIIHandler")>]
abstract member Layout : int * int * int * int -> unit
override this.Layout : int * int * int * int -> unit

Parameters

l
Int32

Left position, relative to parent

t
Int32

Top position, relative to parent

r
Int32

Right position, relative to parent

b
Int32

Bottom position, relative to parent

Attributes

Remarks

Assign a size and position to a view and all of its descendants

This is the second phase of the layout mechanism. (The first is measuring). In this phase, each parent calls layout on all of its children to position them. This is typically done using the child measurements that were stored in the measure pass().

Derived classes should not override this method. Derived classes with children should override onLayout. In that method, they should call layout on each of their children.

Java documentation for android.view.View.layout(int, int, int, 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