Class LayoutItem

Definition

Namespace:
Tizen.NUI
Assembly:
Tizen.NUI.dll

[Draft] Base class for layouts. It is used to layout a View It can be laid out by a LayoutGroup.

C#
Copy
public class LayoutItem : IDisposable
Inheritance
LayoutItem
Derived

Constructors

View Source

LayoutItem()

[Draft] Constructor

Declaration
C#
Copy
public LayoutItem()
API Level: 6

Properties

View Source

LayoutWithTransition

[Draft] Use transition for layouting child

Declaration
C#
Copy
public bool LayoutWithTransition { get; set; }
Property Value
Type Description
Boolean
API Level: 6
View Source

Margin

[Draft] Margin for this LayoutItem

Declaration
C#
Copy
public Extents Margin { get; set; }
Property Value
Type Description
Extents
API Level: 6
View Source

MeasuredHeight

Get the measured height (without any measurement flags).
This method should be used only during measurement and layout calculations.

Declaration
C#
Copy
public MeasuredSize MeasuredHeight { get; set; }
Property Value
Type Description
MeasuredSize
API Level: 6
View Source

MeasuredWidth

Get the measured width (without any measurement flags).
This method should be used only during measurement and layout calculations.

Declaration
C#
Copy
public MeasuredSize MeasuredWidth { get; set; }
Property Value
Type Description
MeasuredSize
API Level: 6
View Source

Owner

[Draft] The View that this Layout has been assigned to.

Declaration
C#
Copy
public View Owner { get; set; }
Property Value
Type Description
View
API Level: 6
View Source

Padding

[Draft] Padding for this LayoutItem

Declaration
C#
Copy
public Extents Padding { get; set; }
Property Value
Type Description
Extents
API Level: 6
View Source

SetPositionByLayout

[Draft] Set position by layouting result

Declaration
C#
Copy
public bool SetPositionByLayout { get; set; }
Property Value
Type Description
Boolean
View Source

SuggestedMinimumHeight

Returns the suggested minimum height that the layout should use.
This returns the maximum of the layout's minimum height and the owner's natural height.

Declaration
C#
Copy
public LayoutLength SuggestedMinimumHeight { get; }
Property Value
Type Description
LayoutLength
API Level: 6
View Source

SuggestedMinimumWidth

Returns the suggested minimum width that the layout should use.
This returns the maximum of the layout's minimum width and the owner's natural width.

Declaration
C#
Copy
public LayoutLength SuggestedMinimumWidth { get; }
Property Value
Type Description
LayoutLength
API Level: 6

Methods

View Source

ChangeLayoutSiblingOrder(Int32)

Sets the sibling order of the layout item so the layout can be defined within the same parent.

Declaration
C#
Copy
public void ChangeLayoutSiblingOrder(int order)
Parameters
Type Name Description
Int32 order

the sibling order of the layout item

View Source

Dispose()

Declaration
C#
Copy
public void Dispose()
View Source

Dispose(Boolean)

Declaration
C#
Copy
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing
View Source

GetDefaultSize(LayoutLength, MeasureSpecification)

Utility to return a default size.
Uses the supplied size if the MeasureSpecification imposed no constraints. Will get larger if allowed by the MeasureSpecification.

Declaration
C#
Copy
public static LayoutLength GetDefaultSize(LayoutLength size, MeasureSpecification measureSpecification)
Parameters
Type Name Description
LayoutLength size

Default size for this layout.

MeasureSpecification measureSpecification

Constraints imposed by the parent.

Returns
Type Description
LayoutLength

The size this layout should be.

API Level: 6
View Source

GetParent()

Get the Layouts parent

Declaration
C#
Copy
public ILayoutParent GetParent()
Returns
Type Description
ILayoutParent

Layout parent with an LayoutParent interface

API Level: 6
View Source

Layout(LayoutLength, LayoutLength, LayoutLength, LayoutLength)

Assign a size and position to a layout 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.

Declaration
C#
Copy
public void Layout(LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
Parameters
Type Name Description
LayoutLength left

Left position, relative to parent.

LayoutLength top

Top position, relative to parent.

LayoutLength right

Right position, relative to parent.

LayoutLength bottom

Bottom position, relative to parent.

API Level: 6
View Source

Layout(LayoutLength, LayoutLength, LayoutLength, LayoutLength, Boolean)

Assign a size and position to a layout 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.

Declaration
C#
Copy
public void Layout(LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom, bool independent)
Parameters
Type Name Description
LayoutLength left

Left position, relative to parent.

LayoutLength top

Top position, relative to parent.

LayoutLength right

Right position, relative to parent.

LayoutLength bottom

Bottom position, relative to parent.

Boolean independent

true, if this layout is not affected by parent layout.

View Source

Measure(MeasureSpecification, MeasureSpecification)

This is called to find out how big a layout should be.
The parent supplies constraint information in the width and height parameters.
The actual measurement work of a layout is performed in OnMeasure called by this method. Therefore, only OnMeasure can and must be overridden by subclasses.

Declaration
C#
Copy
public void Measure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
Parameters
Type Name Description
MeasureSpecification widthMeasureSpec

Horizontal space requirements as imposed by the parent.

MeasureSpecification heightMeasureSpec

Vertical space requirements as imposed by the parent.

API Level: 6
View Source

OnAttachedToOwner()

Virtual method called when this Layout is attached to it's owner. Allows derived layouts to take ownership of child Views and connect to any Owner signals required.

Declaration
C#
Copy
protected virtual void OnAttachedToOwner()
API Level: 6
View Source

OnLayout(Boolean, LayoutLength, LayoutLength, LayoutLength, LayoutLength)

Called from Layout() when this layout should assign a size and position to each of its children.
Derived classes with children should override this method and call Layout() on each of their children.

Declaration
C#
Copy
protected virtual void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
Parameters
Type Name Description
Boolean changed

This is a new size or position for this layout.

LayoutLength left

Left position, relative to parent.

LayoutLength top

Top position, relative to parent.

LayoutLength right

Right position, relative to parent.

LayoutLength bottom

Bottom position, relative to parent.

API Level: 6
View Source

OnMeasure(MeasureSpecification, MeasureSpecification)

Measure the layout and its content to determine the measured width and the measured height.
The base class implementation of measure defaults to the background size, unless a larger size is allowed by the MeasureSpec. Subclasses should override to provide better measurements of their content.
If this method is overridden, it is the subclass's responsibility to make sure the measured height and width are at least the layout's minimum height and width.

Declaration
C#
Copy
protected virtual void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
Parameters
Type Name Description
MeasureSpecification widthMeasureSpec

horizontal space requirements as imposed by the parent.

MeasureSpecification heightMeasureSpec

vertical space requirements as imposed by the parent.

API Level: 6
View Source

OnUnparent()

Virtual method to allow derived classes to remove any children before it is removed from its parent.

Declaration
C#
Copy
protected virtual void OnUnparent()
API Level: 6
View Source

RequestLayout()

Request that this layout is re-laid out.
This will make this layout and all it's parent layouts dirty.

Declaration
C#
Copy
public void RequestLayout()
API Level: 6
View Source

ResolveSizeAndState(LayoutLength, MeasureSpecification, MeasuredSize.StateType)

Utility to reconcile a desired size and state, with constraints imposed by a MeasureSpecification.

Declaration
C#
Copy
protected MeasuredSize ResolveSizeAndState(LayoutLength size, MeasureSpecification measureSpecification, MeasuredSize.StateType childMeasuredState)
Parameters
Type Name Description
LayoutLength size

How big the layout wants to be.

MeasureSpecification measureSpecification

Constraints imposed by the parent.

MeasuredSize.StateType childMeasuredState

Size information bit mask for the layout's children.

Returns
Type Description
MeasuredSize

A measured size, which may indicate that it is too small.

API Level: 6
View Source

SetMeasuredDimensions(MeasuredSize, MeasuredSize)

This method must be called by OnMeasure(MeasureSpec,MeasureSpec) to store the measured width and measured height.

Declaration
C#
Copy
protected void SetMeasuredDimensions(MeasuredSize measuredWidth, MeasuredSize measuredHeight)
Parameters
Type Name Description
MeasuredSize measuredWidth

The measured width of this layout.

MeasuredSize measuredHeight

The measured height of this layout.

API Level: 6

Extension Methods