Android Guides | Samples

Android.Widget.LinearLayout Class

A Layout that arranges its children in a single column or a single row.

See Also: LinearLayout

Syntax

[Android.Runtime.Register("android/widget/LinearLayout", DoNotGenerateAcw=true)]
public class LinearLayout : ViewGroup

Remarks

A Layout that arranges its children in a single column or a single row. The direction of the row can be set by calling LinearLayout.Orientation. You can also specify gravity, which specifies the alignment of all the child elements by calling LinearLayout.SetGravity(GravityFlags) or specify that specific children grow to fill up any remaining space in the layout by setting the weight member of NoType:android/widget/LinearLayout$LayoutParams;Href=../../../reference/android/widget/LinearLayout.LayoutParams.html. The default orientation is horizontal.

See the Linear Layout guide.

Also see NoType:android/widget/LinearLayout$LayoutParams;Href=../../../reference/android/widget/LinearLayout.LayoutParams.html for layout attributes

[Android Documentation]

Requirements

Namespace: Android.Widget
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.Widget.LinearLayout are listed below.

See Also: ViewGroup

Public Constructors

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

BaselineAlignedBoolean.
BaselineAlignedChildIndexInt32.
[read-only]
DividerDrawableDrawable.
DividerPaddingInt32. Get the padding size used to inset dividers in pixels
MeasureWithLargestChildEnabledBoolean. When true, all children with a weight will be considered having the minimum size of the largest child.
OrientationOrientation. Returns the current orientation.
ShowDividersShowDividers.
WeightSumSingle. Returns the desired weights sum.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

SetDividerDrawable(Drawable)
Set a drawable to be used as a divider between items.
SetGravity(GravityFlags)
Describes how the child views are positioned.
SetHorizontalGravity(GravityFlags)
SetVerticalGravity(GravityFlags)

Protected Methods

override
OnLayout(Boolean, Int32, Int32, Int32, Int32)
Called from layout when this view should assign a size and position to each of its children.