Forums

OverviewV-Play 2 Support (Qt 5) › Adding badge notification into a NavigationItem….

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

    Francois

    Hello,

    I would like to add a badge notification ( red circle with a number inside ) into a NavigationItem.

    Is there a way to do that ?

    Thanks for your help.

     

    Best Regards.

     

    F.

    #13848

    Günther
    V-Play Team

    Hi Francois!

    You can customize the NavigationBarItems any way you want. Either create your own NavigationBarItem or just extend an existing one like the IconButtonBarItem.

    This is how you could add a badge to an IconButtonBarItem:

    IconButtonBarItem {
            icon: IconType.globe
            onClicked: { /* DO SOTHEMING */ }
    
            // add badge
            Rectangle {
              x: parent.width * 0.8 - width
              y: parent.height * 0.25
              width: dp(14)
              height: width
              color: "red"
              radius: width * 0.5
    
              AppText {
                text: "3"
                font.pixelSize: sp(9)
                font.bold: true
                anchors.centerIn: parent
                color: "white"
              }
            }
          }

     

    Cheers,
    Günther

    #13849

    Francois

    Hello Günther,

    You rocks !!!

    Many Thanks for your help.

    Best Regards.

     

    F.

     

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

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support