Disappearing barImage when new windows open

You must Login before you can answer or comment on any questions.

Hi Everyone.

Wondering if anyone has a solution to the graphical glitch I'm experiencing with a custom barImage when opening new windows.

I have a main window with a lovely looking nav bar, styled with a custom background image. As a new window opens, either modal or normal, the barImage reverts to the original default blue.

I'm defining my core window using:

// Create home page dashboard window...
var dashboardWin = Titanium.UI.createWindow({  
    title:'App Title',
    backgroundColor:'#eee',
    backgroundImage:'background.png',
    tabBarHidden:true,
    barImage:'titleBar.png',
    titleControl:null,
    titleImage:'title.png'
});
It's a strange little glitch because when working with modal windows, the blue bar only exists while the window is opening, as soon as it closes the main window has it's styled bar again!

Any thoughts on a fix would be much appreciated.

Dave.

9 Answers

Hi, This is my solution : <br> put this code in your app.js (at the end for exemple. I put just after tabTabGroup.open();) :

var vieHelp = Ti.UI.createWindow(
{
    height: 0
});
vieHelp.open();
it's very strange, but it works for me.

— answered 2 years ago by Yann Offredi
answer permalink
4 Comments
  • Thanks for your hack, it works perfectly !

    — commented 2 years ago by Dhaya Benmessaoud

  • Thanks! Going to stick to this hack until this gets properly fixed. Too bad this didnt make it into 1.7 despite all the people struggling with this bug.

    — commented 2 years ago by Jeroen Kntl

  • Just used the same fix. Thanks! Hope it get's fixed soon.

    — commented 2 years ago by Keith Storm

  • Show 1 more comment

Hi guys, I also encountered a similar issue with the barImage showing up and then suddenly disappearing in an app with 5 tabs. After some investigations and some trial and error, I've found that commenting out the code at line 802 of the file TiUIWindowProxy.m in the titanium SDK (I refer to the 1.7.1 release) solved the issue for me:

-(void)_tabBlur
{
    if (focused)
    {
        [self fireFocus:NO];
        //[barImageView removeFromSuperview]; <<-- comment this code
    }
    [super _tabBlur];
}
Indeed the native code that manages windows is quite complex, and probably that line is really useful for handling some corner cases, so be careful!

Thought I'd post a quick image example...

1: Styled Nav Bar http://www.my-showcase.org/media/1301/screen1.jpg

2: Style missing as new window opens http://www.my-showcase.org/media/1306/screen2.jpg

Dave.

Same problem here. Even when using a tab group with a custom navbar and opening a single window results in the default navbar, also when I explicitly set a barImage on the new window. Is this a bug?

Yeah, looks like it's a reported bug but it is currently yet to be scheduled for resolution.

http://appc.me/lh/m/2324

This is a real pain as it's making a sweet looking app appear messy when it's run :-(

Dave.

— answered 2 years ago by Dave Waller
answer permalink
2 Comments
  • Unbelievable, they keep adding features and just forget about all the outstanding really annoying bugs. For now I try to emulate it by setting the barcolor, that one seems to be consistent...

    — commented 2 years ago by Jeroen Kntl

  • @Dave: I've updated the bug (in Jira now), and bumped its priority. http://appc.me/lh/m/2324

    — commented 2 years ago by Dawson Toth

Appcelerator team, we would appreciate some communication on this matter. Especially if you advise us to 'report bugs in Q&A for non-premium members'.

it works for me if i open new window via tab:

Ti.UI.currentTab.open(_win, {animated:true});
it ll keep its barImage. but there is little flash each time i first time open any window. default background appears for couple of milliseconds and just after that my barImage appear.

Your Answer

Think you can help? Login to answer this question!