Tour Preview

Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

NavigationBar

A navigation control for displaying a header, back navigation and optional items. More...

Import Statement: import Felgo 3.0

Properties

Detailed Description

NavigationBar shows a page title, a back button on the left side and optional NavigationBarItem slots.

This component is automatically instantiated inside NavigationStack, for back navigation.

Property Documentation

backButtonItem : Component

This property defines an item that is shown as back bar button item.

By default a back arrow Icon is provided, which is sufficient in most cases. If you want to customize that icon you can make use of backButtonItemPressed property to define a custom style for the pressed state.

Here is an example of providing your custom item within a NavigationStack:

 NavigationStack {
  id: stack

   navigationBar.backButtonItem: Text {
     text: "Back"
     anchors.centerIn: parent
     color: stack.navigationBar.backButtonItemPressed ? "red" : "green"
   }
 }

See also backButtonItemPressed.


[read-only] backButtonItemPressed : bool

Use this readonly property to customize the pressed state of a custom provided backButtonItem.

See also backButtonItem.


backButtonVisible : bool

Holds whether the back button is shown or not. If false, the leftBarItem will appear in the left item slot, if set. If true, the backButton will appear in the left item slot.


backgroundColor : color

The background color fills the NavigationBar's background.

By default the globally set value from ThemeNavigationBar::backgroundColor is used, which is chosen to match the target platform.

Note: You should only overwrite this value if you want to provide a NavigationStack or NavigationBar in your app that needs a different style than your default one. Otherwise you should use ThemeNavigationBar::backgroundColor for customization.

This property was introduced in Felgo 2.14.2.


backgroundImageFillMode : int

The fillMode to use for the NavigationBar's background if the backgroundImageSource is set.

If no value is set, the globally set value from ThemeNavigationBar::fillMode is used, which defaults to Image.Tile.

Setting this property to another value might be useful of you don't provide a pattern image as backgroundImageSource.

Note: You should only overwrite this value if you want to add a NavigationStack or NavigationBar in your app that needs a different style than your default one. Otherwise you should use ThemeNavigationBar::backgroundImageFillMode for customization.

This property was introduced in Felgo 2.14.2.


backgroundImageSource : url

An image source URL to fill the NavigationBar's background, like a pattern image.

If no value is set, the globally set value from ThemeNavigationBar::backgroundImageSource is used, which defaults to an empty image and the NavigationBar only fills with the provided backgroundColor then.

This property is useful if you want to provide a background image like a background pattern for the NavigationBar.

Note: You should only overwrite this value if you want to add a NavigationStack or NavigationBar in your app that needs a different style than your default one. Otherwise you should use ThemeNavigationBar::backgroundImageSource for customization.

This property was introduced in Felgo 2.14.2.


defaultBarItemPadding : real

Sets the default left and right padding in pixels for items based on the NavigationBarItem type. By default, this is equal to ThemeNavigationBar::defaultBarItemPadding.

This property was introduced in Felgo 3.7.0.


dividerColor : color

The divider is displayed as a thin line at the very bottom of the navigation bar. Override the divider color to customize the look of the divider. By default, this is equal to ThemeNavigationBar::dividerColor.

This property was introduced in Felgo 3.7.0.


fillMode : enumeration

The fillMode to use for the NavigationBar's background if the backgroundImageSource is set.

If no value is set, the globally set value from ThemeNavigationBar::fillMode is used, which defaults to Image.Tile.

Setting this property to another value might be useful of you don't provide a pattern image as backgroundImageSource.

Note: You should only overwrite this value if you want to add a NavigationStack or NavigationBar in your app that needs a different style than your default one. Otherwise you should use ThemeNavigationBar::backgroundImageFillMode for customization.

This property was introduced in Felgo 2.14.2.


itemColor : color

The item color defines the NavigationBar's left and right item color. By default, this is equal to ThemeNavigationBar::itemColor.

This property was introduced in Felgo 3.7.0.


leftBarItem : Item

An Item derived from NavigationBarItem to appear in the left item slot. This is only used, when the back button is not shown.


rightBarItem : Item

An Item derived from NavigationBarItem to appear in the right item slot.


shadowHeight : real

Defines the height of the shadow beneath the navigation bar in pixels. By default, this is equal to ThemeNavigationBar::shadowHeight.

This property was introduced in Felgo 3.7.0.


titleAlignBottom : int

Whether the title should be bottom aligned. By default, this is equal to ThemeNavigationBar::titleAlignBottom.

This property was introduced in Felgo 3.7.0.


titleAlignLeft : bool

Whether the title should be left aligned. By default, this is equal to ThemeNavigationBar::titleAlignLeft.

This property was introduced in Felgo 3.7.0.


titleBottomMargin : real

Adds an additional margin to the bottom of the navigationBar's title item if it is bottom-aligned, in pixels. By default, this is equal to ThemeNavigationBar::titleBottomMargin.

This property was introduced in Felgo 3.7.0.


titleColor : color

The title color defines the font color of the displayed title label. By default, this is equal to ThemeNavigationBar::titleColor.

This property was introduced in Felgo 3.7.0.


titleItem : Item

An Item derived from NavigationBarItem to appear in the title slot of the navigation bar.

This property was introduced in Felgo 2.6.2.


titleLeftMargin : real

Adds an additional margin to the left of the navigationBar's title item if it is left-aligned, in pixels. By default, this is equal to ThemeNavigationBar::titleLeftMargin.

This property was introduced in Felgo 3.7.0.


titleTextBold : bool

Whether the title text is displayed bold. By default, this is equal to ThemeNavigationBar::titleTextBold.

This property was introduced in Felgo 3.7.0.


titleTextFont : string

Specifies the font for the NavigationBar's title text. By default, this is equal to ThemeNavigationBar::titleTextFont.

This property was introduced in Felgo 3.7.0.


titleTextSize : int

Size of the title text, in pixels. By default, this is equal to ThemeNavigationBar::titleTextFont.

This property was introduced in Felgo 3.7.0.