Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 149
Registered: ‎04-23-2011
My Device: BlackBerry 9700 Bold
My Carrier: Turkcell

Static titleBar in NavigationPane?

Hi,

 

I have a main.qml with a NavigationPane as the root, and a page with a titleBar control. I'd like to have the titleBar to be static in all of the pages, but it seems that we cannot have titleBar or Container controls in NavigationPane and have to add the titleBar to the top of all the pages.

 

Is there a better way to accomplish that?

 

 

 

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Static titleBar in NavigationPane?

[ Edited ]

There's no reason you can't create a single instance of TitleBar in C++ and then use it in all your QML files as far as I can see although I haven't tried it.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Static titleBar in NavigationPane?

TitleBar* tb = new TitleBar();
tb->setTitle("This is a page title");
Page* page1 = Page::create().titleBar(tb);
Page* page2 = Page::create().titleBar(tb);

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Retired
Posts: 85
Registered: ‎05-25-2012
My Device: Limited Edition Z10
My Carrier: Bell

Re: Static titleBar in NavigationPane?

The above looks correct.  You could also create a separate QML file for the title bar and load it in each page.  The Social Invocation sample shows a "GeneralBlock" object that is created several times in the main.qml:

 

https://github.com/blackberry/Cascades-Samples/tree/master/socialinvocation/assets

 

Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: Static titleBar in NavigationPane?

or you can place the titlebar in NavigationPane as ComponentDefinition

 

then for all your Pages do something like this

 

eventPage.titleBar = serverTitlebarComponent.createObject(eventPage)

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 263
Registered: ‎05-18-2011
My Device: Curve 9300, BB10 Dev Alpha C, Z10

Re: Static titleBar in NavigationPane?

I think burakk is already aware of the title bar for each page. He is wondering about a static title bar (i.e one memory object) which can be shared with all pages. I will vote for this feature.
--tom