Google is committed to advancing racial equity for Black communities. See how.

LinearLayoutCompat.LayoutParams

public static class LinearLayoutCompat.LayoutParams
extends ViewGroup.MarginLayoutParams

java.lang.Object
   ↳ android.view.ViewGroup.LayoutParams
     ↳ android.view.ViewGroup.MarginLayoutParams
       ↳ androidx.appcompat.widget.LinearLayoutCompat.LayoutParams


Per-child layout information associated with ViewLinearLayout.

Summary

Inherited constants

Fields

public int gravity

Gravity for the view associated with these LayoutParams.

public float weight

Indicates how much of the extra space in the LinearLayout will be allocated to the view associated with these LayoutParams.

Inherited fields

Public constructors

LayoutParams(Context c, AttributeSet attrs)

LayoutParams(int width, int height)

LayoutParams(int width, int height, float weight)

Creates a new set of layout parameters with the specified width, height and weight.

LayoutParams(ViewGroup.LayoutParams p)

LayoutParams(ViewGroup.MarginLayoutParams source)

LayoutParams(LinearLayoutCompat.LayoutParams source)

Copy constructor.

Inherited methods

Fields

gravity

public int gravity

Gravity for the view associated with these LayoutParams.

See also:

weight

public float weight

Indicates how much of the extra space in the LinearLayout will be allocated to the view associated with these LayoutParams. Specify 0 if the view should not be stretched. Otherwise the extra pixels will be pro-rated among all views whose weight is greater than 0.

Public constructors

LayoutParams

public LayoutParams (Context c, 
                AttributeSet attrs)

Parameters
c Context

attrs AttributeSet

LayoutParams

public LayoutParams (int width, 
                int height)

Parameters
width int

height int

LayoutParams

public LayoutParams (int width, 
                int height, 
                float weight)

Creates a new set of layout parameters with the specified width, height and weight.

Parameters
width int: the width, either ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT or a fixed size in pixels

height int: the height, either ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT or a fixed size in pixels

weight float: the weight

LayoutParams

public LayoutParams (ViewGroup.LayoutParams p)

Parameters
p ViewGroup.LayoutParams

LayoutParams

public LayoutParams (ViewGroup.MarginLayoutParams source)

Parameters
source ViewGroup.MarginLayoutParams

LayoutParams

public LayoutParams (LinearLayoutCompat.LayoutParams source)

Copy constructor. Clones the width, height, margin values, weight, and gravity of the source.

Parameters
source LinearLayoutCompat.LayoutParams: The layout params to copy from.