Class AppBar
AppBar is a component that can be used to display a title, a back button, a drawer button and a set of actions.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: solution.dll
Syntax
public class AppBar : ExVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement
Constructors
AppBar()
Creates a new AppBar.
Declaration
public AppBar()
Fields
actionContainerUssClassName
USS class name of the AppBar's action container.
Declaration
public static readonly string actionContainerUssClassName
Field Value
Type | Description |
---|---|
string |
backButtonUssClassName
USS class name of the AppBar's back button.
Declaration
public static readonly string backButtonUssClassName
Field Value
Type | Description |
---|---|
string |
barUssClassName
USS class name of the AppBar's bar.
Declaration
public static readonly string barUssClassName
Field Value
Type | Description |
---|---|
string |
bottomBorderUssClassName
USS class name of the AppBar's bottom border element.
Declaration
public static readonly string bottomBorderUssClassName
Field Value
Type | Description |
---|---|
string |
bottomUssClassName
USS class name of the AppBar's bottom element.
Declaration
public static readonly string bottomUssClassName
Field Value
Type | Description |
---|---|
string |
compactTitleUssClassName
USS class name of the AppBar's compact title.
Declaration
public static readonly string compactTitleUssClassName
Field Value
Type | Description |
---|---|
string |
compactUssClassName
USS class name of the AppBar's compact variant.
Declaration
public static readonly string compactUssClassName
Field Value
Type | Description |
---|---|
string |
drawerButtonUssClassName
USS class name of the AppBar's drawer button.
Declaration
public static readonly string drawerButtonUssClassName
Field Value
Type | Description |
---|---|
string |
flexibleSpaceUssClassName
USS class name of the AppBar's flexible space.
Declaration
public static readonly string flexibleSpaceUssClassName
Field Value
Type | Description |
---|---|
string |
largeTitleUssClassName
USS class name of the AppBar's large title.
Declaration
public static readonly string largeTitleUssClassName
Field Value
Type | Description |
---|---|
string |
stretchUssClassName
USS class name of the AppBar's stretch variant.
Declaration
public static readonly string stretchUssClassName
Field Value
Type | Description |
---|---|
string |
ussClassName
Main USS class name of the AppBar.
Declaration
public static readonly string ussClassName
Field Value
Type | Description |
---|---|
string |
Properties
bottom
Container element for the AppBar's bottom element. This element is located below the flexible space.
Declaration
public VisualElement bottom { get; }
Property Value
Type | Description |
---|---|
VisualElement |
compact
The compactness of the AppBar. Set to true to make it compact. Set to false to use the default size.
Declaration
public bool compact { get; set; }
Property Value
Type | Description |
---|---|
bool |
contentContainer
The content container of this element.
Declaration
public override VisualElement contentContainer { get; }
Property Value
Type | Description |
---|---|
VisualElement |
Overrides
elevation
The elevation of the AppBar.
Declaration
public int elevation { get; set; }
Property Value
Type | Description |
---|---|
int |
expandedHeight
The height of the AppBar when it is expanded. See stretch.
Declaration
public float expandedHeight { get; set; }
Property Value
Type | Description |
---|---|
float |
flexibleSpace
The flexible space element.
Declaration
public VisualElement flexibleSpace { get; }
Property Value
Type | Description |
---|---|
VisualElement |
scrollOffset
Set this value based on the scrollview's scrollOffset in order to stretch the AppBar accordingly.
Declaration
public float scrollOffset { get; set; }
Property Value
Type | Description |
---|---|
float |
showBackButton
Display or hide the AppBar's back button.
Declaration
public bool showBackButton { get; set; }
Property Value
Type | Description |
---|---|
bool |
showDrawerButton
Display or hide the AppBar's drawer button.
Declaration
public bool showDrawerButton { get; set; }
Property Value
Type | Description |
---|---|
bool |
stretch
The stretch of the AppBar. Set to true to make it stretchable. Set to false to make it fixed.
Declaration
public bool stretch { get; set; }
Property Value
Type | Description |
---|---|
bool |
title
The AppBar's title.
Declaration
public string title { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
AddAction(VisualElement)
Add a new action to the AppBar.
Declaration
public void AddAction(VisualElement actionVisualElement)
Parameters
Type | Name | Description |
---|---|---|
VisualElement | actionVisualElement | The action to add. |
Events
backButtonTriggered
Event triggered when the AppBar's back button is pressed.
Declaration
public event Action backButtonTriggered
Event Type
Type | Description |
---|---|
Action |
drawerButtonTriggered
Event triggered when the AppBar's drawer button is pressed.
Declaration
public event Action drawerButtonTriggered
Event Type
Type | Description |
---|---|
Action |
stretchTriggered
Event triggered when the AppBar is being stretched. The float parameter is the stretch ratio (0.0 to 1.0).
Declaration
public event Action<float> stretchTriggered
Event Type
Type | Description |
---|---|
Action<float> |