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
Super Contributor
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook
My Carrier: NA
Accepted Solution

Title Bars not disappearing

I have a number of title bars across my app.

 

The problem is, when I navigate to and from pages, the last seen title bar on another page still remains and the new title bar pushes across it.

.

So for example:

 

Page A - Title Bar = "Page A"

Then I go to Page B, no title bar on this page and it works correctly and nothing is shown

Then I go to Page C, page A's title bar is shown and Page C's title bar pushes across it

 

Does anyone know how to get rid of the problem?

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Developer
Posts: 91
Registered: ‎09-25-2012
My Device: bb10 alpha
My Carrier: free

Re: Title Bars not disappearing

Strange , could you past a small example of your code  ?

a lover of Qt
Super Contributor
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook
My Carrier: NA

Re: Title Bars not disappearing

I use a tabbed pane to go from page A to page B. Here is an example of how I set up a tab.

 

myTab = new Tab();
myTab->setContent(classA->navigationPane);
tabbedPane->add(myTab);

 I then have a segmented title bar on page A:

 

TitleBar* titleBar = new TitleBar(TitleBarKind::Segmented);
titleBar->setTitle(QString("My Title Bar"));
titleBar->addOption(Option::create().text("Op1"));
titleBar->addOption(Option::create().text("Op2"));
titleBar->addOption(Option::create().text("Op3"));

 Page B has no title bar.

 

Page C does:

 

TitleBar* titleBar = new TitleBar();
	titleBar->setTitle(QString("Title Bar C"));
	page->setTitleBar(titleBar);

 Page C is pushed on to page B when a nav is pressed. That's when the segmented control still stays on screen.

 

I have found some work arounds. Such as deleteing and recreating each page when the corresponding nav pane is pressed. The problem with this is that you get a black flash when the you load each page - before the image views load etc. Not ideal. Is there a way to load a pages' content before it is shown to the user?

 

Another work around was to set the visibility on or off for page A's title bar for when you nav on and off the page.

 

titleBar->setVisibility(bb::cascades::ChromeVisibility::Hidden);

 

titleBar->setVisibility(bb::cascades::ChromeVisibility::Visible);

 

The problem with this is, the title bar animates down over the page, I would rather have it static. Is there a way to turn on ImplicitAnimationController for a title bar?

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Developer
Posts: 251
Registered: ‎11-22-2011
My Device: Blackberry Playbook
My Carrier: vodafone

Re: Title Bars not disappearing

I have the same issue.

No idea how to solve it?

Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: Title Bars not disappearing

The title bars appear to be hopelessly broken.

 

I would recomend just coding your own title. I use the following...

import bb.cascades 1.0

Container
{
    property alias text: title.text
    background: Color.create ("#4a4a4a")
    horizontalAlignment: HorizontalAlignment.Fill
    Container
    {
        leftPadding: 25
        rightPadding: 0
        layout: StackLayout
        {
            orientation: LayoutOrientation.LeftToRight
        }

        Label
        {
            id:title
            horizontalAlignment: HorizontalAlignment.Left
            layoutProperties: StackLayoutProperties
            {            
                spaceQuota: 1
            }
            textStyle
            {
                base: SystemDefaults.TextStyles.BigText
            }
        }
    }
}

 


Read my thoughts on BlackBerry Development at news.ebscer.com
Developer
Posts: 251
Registered: ‎11-22-2011
My Device: Blackberry Playbook
My Carrier: vodafone

Re: Title Bars not disappearing

[ Edited ]

I think you are right, Ebscer.

I spent additional houres to find a kind of workaround without success, so i replaced the titelbars with a container / segmented control combination.

Unfortunally its not the same. I use the bright theme, so the segmented control has a black font-color and can not be combined with a dark title-background - so i needed to change the design of the complete app. 

In my current app it does not matter - the solution looks even better than before - but a customizable and working titlebar-component is something i wishfully waiting for.

Highlighted
Super Contributor
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook
My Carrier: NA

Re: Title Bars not disappearing

After many hours of trying I did find a work around to the issue.

 

delete titleBar;
titleBar = new TitleBar(TitleBarKind::Segmented);
titleBar->setTitle(QString(""));
titleBar->addOption(Option::create().text(""));
titleBar->setVisibility(bb::cascades::ChromeVisibility::Hidden);
page->setTitleBar(titleBar);

I delete and reset a blank title bar for my page before pushing on another page with a different title bar to the title bar that was sticking.

 

 

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Developer
Posts: 251
Registered: ‎11-22-2011
My Device: Blackberry Playbook
My Carrier: vodafone

Re: Title Bars not disappearing

Oh, thats interisting. I was  looking for a pure-QML solution with no success.Thanks.