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#Copypublic class LayoutItem : IDisposable
- Inheritance
-
LayoutItem
- Derived
Constructors
Declaration
C#Copypublic LayoutItem()
API Level: 6
Properties
Declaration
C#Copypublic bool LayoutWithTransition { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: 6
Declaration
C#Copypublic Extents Margin { get; set; }
Property Value
Type | Description |
---|---|
Extents |
API Level: 6
MeasuredHeight
Get the measured height (without any measurement flags).
This method should be used only during measurement and layout calculations.
Declaration
C#Copypublic MeasuredSize MeasuredHeight { get; set; }
Property Value
Type | Description |
---|---|
MeasuredSize |
API Level: 6
MeasuredWidth
Get the measured width (without any measurement flags).
This method should be used only during measurement and layout calculations.
Declaration
C#Copypublic MeasuredSize MeasuredWidth { get; set; }
Property Value
Type | Description |
---|---|
MeasuredSize |
API Level: 6
Declaration
C#Copypublic View Owner { get; set; }
Property Value
Type | Description |
---|---|
View |
API Level: 6
Declaration
C#Copypublic Extents Padding { get; set; }
Property Value
Type | Description |
---|---|
Extents |
API Level: 6
Declaration
C#Copypublic bool SetPositionByLayout { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
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#Copypublic LayoutLength SuggestedMinimumHeight { get; }
Property Value
Type | Description |
---|---|
LayoutLength |
API Level: 6
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#Copypublic LayoutLength SuggestedMinimumWidth { get; }
Property Value
Type | Description |
---|---|
LayoutLength |
API Level: 6
Methods
ChangeLayoutSiblingOrder(Int32)
Sets the sibling order of the layout item so the layout can be defined within the same parent.
Declaration
C#Copypublic void ChangeLayoutSiblingOrder(int order)
Parameters
Type | Name | Description |
---|---|---|
Int32 | order | the sibling order of the layout item |
Declaration
C#Copypublic void Dispose()
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing |
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#Copypublic 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
Declaration
C#Copypublic ILayoutParent GetParent()
Returns
Type | Description |
---|---|
ILayoutParent | Layout parent with an LayoutParent interface |
API Level: 6
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#Copypublic 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
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#Copypublic 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. |
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#Copypublic 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
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#Copyprotected virtual void OnAttachedToOwner()
API Level: 6
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#Copyprotected 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
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#Copyprotected 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
OnUnparent()
Virtual method to allow derived classes to remove any children before it is removed from its parent.
Declaration
C#Copyprotected virtual void OnUnparent()
API Level: 6
RequestLayout()
Request that this layout is re-laid out.
This will make this layout and all it's parent layouts dirty.
Declaration
C#Copypublic void RequestLayout()
API Level: 6
ResolveSizeAndState(LayoutLength, MeasureSpecification, MeasuredSize.StateType)
Utility to reconcile a desired size and state, with constraints imposed by a MeasureSpecification.
Declaration
C#Copyprotected 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
SetMeasuredDimensions(MeasuredSize, MeasuredSize)
This method must be called by OnMeasure(MeasureSpec,MeasureSpec) to store the measured width and measured height.
Declaration
C#Copyprotected 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. |