Tab
Based on UIView
Description
Base view for tab content displayed within the TabPanel.
Examples
Static TabPanel:
<TabPanel>
<Tab Text="Tab 1">
<Label Text="Tab Content 1" />
</Tab>
<Tab Text="Tab 2">
<Label Text="Tab Content 2" />
</Tab>
</TabPanel>
Dynamic TabPanel:
<TabPanel Items="{player in @Players}">
<TabHeader Text="{player.Name}"/>
<Tab>
<Label Text="Content for {player.Name}" />
</Tab>
</TabPanel>
Static TabPanel with multiple custom tab headers:
<TabPanel>
<TabHeader Id="Header1" />
<TabHeader Id="Header2" TextMargin="20,0,0,0">
<CheckBox Alignment="Left" Offset="10,0,0,0" />
</TabHeader>
<Tab Text="Tab 1" TabHeaderId="Header1">
<Label Text="Tab Content 1" />
</Tab>
<Tab Text="Tab 2" TabHeaderId="Header1">
<Label Text="Tab Content 2" />
</Tab>
<Tab Text="Tab 3" TabHeaderId="Header2">
<Label Text="Tab Content 2" />
</Tab>
</TabPanel>
Dependency Properties
Name | Type | Description |
---|---|---|
Alignment | ElementAlignment | Used to align the view relative to the layout parent region it resides in. |
Alpha | float | Can be used to adjust the alpha color of this view and all its children. E.g. used for fade in/out animations. Is separate from and different from the background color of the view as it affects the children as well. |
BubbleNotifyChildLayoutChanged | bool | Boolean indicating if parent always should be notified when the child changes layout. |
ContentTemplateData | ContentTemplateData | Holds the content template data. |
DisableLayoutUpdate | bool | Boolean indicating if automatic layout updates for this view should be disabled. When disabled the view doesn’t call UpdateLayout() when properties such as Width, Height, etc. changes. |
EnableScriptEvents | bool | Boolean indicating if unity script events (Update, LateUpdate, Awake, etc) should be relayed to the view code-behind through the corresponding methods that can be overriden. |
GameObject | GameObject | GameObject in the hierarchy that corresponds to the view. |
Height | ElementSize | The height of the view in pixels or percents. |
IgnoreFlip | bool | Used when doing localization override default behavior of flipping the view Right to Left or Left to Rigth. |
IgnoreObject | bool | Boolean indicating if the view should be ignored. Ignored objects don’t run any load logic and don’t respond to property changed events. |
IsActive | bool | Boolean indicating if the view is active. Deactivated views deactivates corresponding game object, components, renderers and scripts. |
IsVisible | bool | Boolean indicating if view is visible or hidden. Invisible views still take up space but aren’t interactable and have their alpha set to 0. |
LoadMode | LoadMode | Enum flags indicating when and how the view should be loaded by the framework. Can be changed when e.g. the view is to be loaded on-demand. |
Margin | ElementMargin | Adding margins to a view changes the size of the area in which its content resides, but it does not change the width or height of the view. |
Offset | ElementMargin | Determines the offset of the view. |
OffsetFromParent | ElementMargin | Offset set by a parent view. Used by views like Group to arrange children without changing their own Offset values. |
OverrideHeight | ElementSize | Overrides regular Height value. Used to e.g. automatically size items without changing the default Height value set. |
OverrideWidth | ElementSize | Overrides regular Width value. Used to e.g. automatically size items without changing the default Width value set. |
Pivot | Vector2 | The pivot point of the view. |
Position | Vector3 | Directly sets the local position of the view relative to parent. Position otherwise set using the Alignment and Offset properties. |
RaycastBlockMode | RaycastBlockMode | Enum indicating if raycasts should be blocked. |
Rotation | Quaternion | Rotation of the view. |
Scale | Vector3 | Scale of the view. |
TabHeaderId | string | ID of TabHeader belonging to this tab. |
Text | string | Default tab header text. |
UseFastShader | bool | Boolean indicating if the default UI shader should be replaced by a simpler and faster one. The faster shader does not support masking and clipping. |
Width | ElementSize | The width of the view in pixels or percents. |