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!

Forums

OverviewFelgo 2 Support (Qt 5) › Center NavigationBar title item

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #16488

    Kool

    Hi all,

    I’m wondering if it’s possible to center the NavigationBar title item? At the moment it’s pushed to the left and I’m wondering if it’s possible to center it.

    Minimal example:

    import Felgo 3.0
    import QtQuick 2.0
    
    GameWindow {
        id: gameWindow
        activeScene: scene
        screenWidth: 960
        screenHeight: 640
    
        Scene {
            id: scene
    
            width: 480
            height: 320
    
            NavigationBar {
                id: tabBar
                anchors {top: scene.gameWindowAnchorItem.top; left: scene.gameWindowAnchorItem.left; right: scene.gameWindowAnchorItem.right}
                backButtonVisible: true
                titleItem: AppText {
                    text: "Training"
                    color: Theme.backgroundColor
                }
            }
        }
    }

    Many thanks!

    #16491

    G√ľnther
    Felgo Team

    Hi Kool!

    To match platform-specific UI guidelines, the title is e.g. displayed centered on iOS and left-aligned on Android. To always center the title, you can set:

          Theme.navigationBar.titleAlignLeft = false

    Best,
    G√ľnther from Felgo

    #16493

    Kool

    If that’s the platform-specific guideline for iOS vs Android, I’ll probably keep it as it is rather than always center.

    But it’s good to know.

    Thanks Gunther.

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.