Class RelativeLayout
Definition
- Assembly:
- Tizen.NUI.dll
RelativeLayout calculates the size and position of all the children based on their relationship to each other.
public class RelativeLayout : LayoutGroup, ILayoutParent
- Inheritance
- Implements
Constructors
View SourceRelativeLayout()
Constructor
Declaration
public RelativeLayout()
Fields
View SourceBottomRelativeOffsetProperty
BottomRelativeOffsetProperty
Declaration
public static readonly BindableProperty BottomRelativeOffsetProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
BottomTargetProperty
BottomTargetProperty
Declaration
public static readonly BindableProperty BottomTargetProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
FillHorizontalProperty
FillHorizontalProperty
Declaration
public static readonly BindableProperty FillHorizontalProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
FillVerticalProperty
FillVerticalProperty
Declaration
public static readonly BindableProperty FillVerticalProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
HorizontalAlignmentProperty
HorizontalAlignmentProperty
Declaration
public static readonly BindableProperty HorizontalAlignmentProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
LeftRelativeOffsetProperty
LeftRelativeOffsetProperty
Declaration
public static readonly BindableProperty LeftRelativeOffsetProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
LeftTargetProperty
LeftTargetProperty
Declaration
public static readonly BindableProperty LeftTargetProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
RightRelativeOffsetProperty
RightRelativeOffsetProperty
Declaration
public static readonly BindableProperty RightRelativeOffsetProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
RightTargetProperty
RightTargetProperty
Declaration
public static readonly BindableProperty RightTargetProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
TopRelativeOffsetProperty
TopRelativeOffsetProperty
Declaration
public static readonly BindableProperty TopRelativeOffsetProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
TopTargetProperty
TopTargetProperty
Declaration
public static readonly BindableProperty TopTargetProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
VerticalAlignmentProperty
VerticalAlignmentProperty
Declaration
public static readonly BindableProperty VerticalAlignmentProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
Methods
View SourceGetBottomRelativeOffset(View)
Gets bottom relative offset.
Declaration
public static float GetBottomRelativeOffset(View view)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view whose size and position is being changed. |
Returns
| Type | Description |
|---|---|
| float | The ratio between top and bottom of the BottomRelativeOffsetProperty. |
GetBottomTarget(BindableObject)
Gets bottom target object whose size and position is being used as reference.
Declaration
public static View GetBottomTarget(BindableObject view)
Parameters
| Type | Name | Description |
|---|---|---|
| BindableObject | view | The child view whose size and position is being changed. |
Returns
| Type | Description |
|---|---|
| View | The object whose size and position is being used as reference. |
GetFillHorizontal(View)
Gets the boolean value whether child fills its horizontal space.
Declaration
public static bool GetFillHorizontal(View view)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view. |
Returns
| Type | Description |
|---|---|
| bool | True if to fill the space, false otherwise. |
GetFillVertical(View)
Gets the boolean value whether child fills its vertical space.
Declaration
public static bool GetFillVertical(View view)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view. |
Returns
| Type | Description |
|---|---|
| bool | True if to fill the space, false otherwise. |
GetHorizontalAlignment(View)
Gets the horizontal alignment
Declaration
public static RelativeLayout.Alignment GetHorizontalAlignment(View view)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view. |
Returns
| Type | Description |
|---|---|
| RelativeLayout.Alignment | The horizontal alignment of |
GetLeftRelativeOffset(View)
Gets left relative offset.
Declaration
public static float GetLeftRelativeOffset(View view)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view whose size and position is being changed. |
Returns
| Type | Description |
|---|---|
| float | The ratio between left and right of the LeftTargetProperty. |
GetLeftTarget(BindableObject)
Gets left target object whose size and position is being used as reference.
Declaration
public static View GetLeftTarget(BindableObject view)
Parameters
| Type | Name | Description |
|---|---|---|
| BindableObject | view | The child view whose size and position is being changed. |
Returns
| Type | Description |
|---|---|
| View | The object whose size and position is being used as reference. |
GetRightRelativeOffset(View)
Gets right relative offset.
Declaration
public static float GetRightRelativeOffset(View view)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view whose size and position is being changed. |
Returns
| Type | Description |
|---|---|
| float | The ratio between left and right of the RightTargetProperty. |
GetRightTarget(BindableObject)
Gets right target object whose size and position is being used as reference.
Declaration
public static View GetRightTarget(BindableObject view)
Parameters
| Type | Name | Description |
|---|---|---|
| BindableObject | view | The child view whose size and position is being changed. |
Returns
| Type | Description |
|---|---|
| View | The object whose size and position is being used as reference. |
GetTopRelativeOffset(View)
Gets top relative offset.
Declaration
public static float GetTopRelativeOffset(View view)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view whose size and position is being changed. |
Returns
| Type | Description |
|---|---|
| float | The ratio between top and bottom of the TopTargetProperty. |
GetTopTarget(BindableObject)
Gets top target object whose size and position is being used as reference.
Declaration
public static View GetTopTarget(BindableObject view)
Parameters
| Type | Name | Description |
|---|---|---|
| BindableObject | view | The child view whose size and position is being changed. |
Returns
| Type | Description |
|---|---|
| View | The object whose size and position is being used as reference. |
GetVerticalAlignment(View)
Gets the vertical alignment
Declaration
public static RelativeLayout.Alignment GetVerticalAlignment(View view)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view. |
Returns
| Type | Description |
|---|---|
| RelativeLayout.Alignment | The vertical alignment of |
OnLayout(bool, 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
protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | 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. |
Overrides
View SourceOnMeasure(MeasureSpecification, MeasureSpecification)
Measure the layout and its content to determine the measured width and the measured height.
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
protected override 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. |
Overrides
View SourceSetBottomRelativeOffset(View, float)
Sets the relative offset for bottom target.
When value is 0 the bottom edge of the view is aligned to the top edge of the bottom target.
When value is 1 the bottom edges of the bottom target and view are aligned.
Declaration
public static void SetBottomRelativeOffset(View view, float value)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view whose size and position is being changed. |
| float | value | The ratio between left and right of the BottomRelativeOffsetProperty. |
SetBottomTarget(View, View)
Specifies the bottom side edge of the child view relative to the target view.
null reference means parent relative layout.
Declaration
public static void SetBottomTarget(View view, View reference)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view whose size and position is being changed. |
| View | reference | The object whose size and position is being used as reference. |
SetFillHorizontal(View, bool)
Sets the boolean value whether child fills its horizontal space.
Declaration
public static void SetFillHorizontal(View view, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view. |
| bool | value | True if to fill the space, false otherwise. |
SetFillVertical(View, bool)
Sets the boolean value whether child fills its vertical space.
Declaration
public static void SetFillVertical(View view, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view. |
| bool | value | True if to fill the space, false otherwise. |
SetHorizontalAlignment(View, Alignment)
Sets the horizontal alignment of this child view.
Declaration
public static void SetHorizontalAlignment(View view, RelativeLayout.Alignment value)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view. |
| RelativeLayout.Alignment | value | The horizontal alignment of |
SetLeftRelativeOffset(View, float)
Sets the relative offset for left target.
When value is 0 the left edges of the left target and view are aligned.
When value is 1 the left edge of the view is aligned to the right edge of the left target.
Declaration
public static void SetLeftRelativeOffset(View view, float value)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view whose size and position is being changed. |
| float | value | The ratio between left and right of the LeftTargetProperty. |
SetLeftTarget(View, View)
Specifies the left side edge of the child view relative to the target view.
null reference means parent relative layout.
Declaration
public static void SetLeftTarget(View view, View reference)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view whose size and position is being changed. |
| View | reference | The object whose size and position is being used as reference. |
SetRightRelativeOffset(View, float)
Sets the relative offset for right target.
When value is 0 the right edge of the view is aligned to the left edge of the right target.
When value is 1 the right edges of the right target and view are aligned.
Declaration
public static void SetRightRelativeOffset(View view, float value)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view whose size and position is being changed. |
| float | value | The ratio between left and right of the RightTargetProperty. |
SetRightTarget(View, View)
Specifies the right side edge of the child view relative to the target view.
null reference means parent relative layout.
Declaration
public static void SetRightTarget(View view, View reference)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view whose size and position is being changed. |
| View | reference | The object whose size and position is being used as reference. |
SetTopRelativeOffset(View, float)
Sets the relative offset for top target.
When value is 0 the top edges of the top target and view are aligned.
When value is 1 the top edge of the view is aligned to the bottom edge of the top target.
Declaration
public static void SetTopRelativeOffset(View view, float value)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view whose size and position is being changed. |
| float | value | The ratio between left and right of the TopTargetProperty. |
SetTopTarget(View, View)
Specifies the top side edge of the child view relative to the target view.
null reference means parent relative layout.
Declaration
public static void SetTopTarget(View view, View reference)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view whose size and position is being changed. |
| View | reference | The object whose size and position is being used as reference. |
SetVerticalAlignment(View, Alignment)
Sets the vertical alignment of this child view.
Declaration
public static void SetVerticalAlignment(View view, RelativeLayout.Alignment value)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The child view. |
| RelativeLayout.Alignment | value | The vertical alignment of |