Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

title bar

This question is related to the following one: http://developer.appcelerator.com/question/85961/tabgroup-background-color

The problem was that I needed to style a tabGroup, but since that's not possible, I recreated the tabGroup with images and buttons.

The problem that I now have is that I don't have a title bar, and opening it as a modal window isn't a sollution.

I'll show it with some code, this is my app.js

Titanium.UI.setBackgroundColor('#3c3c3c');

var mainWindow = Ti.UI.createWindow({
    backgroundImage: 'assets/bgPattern.png',
    url: 'main.js'
});
mainWindow.open();

Nothing special, just a normal window with a background image.

This is my main.js: http://pastie.org/1348163

I just created a window and an image (the tabGroup).

But now I don't have a title bar, i can open the window in modal mode, but then i lose my images (even with a window height).

So i'm a little bit stuck here, I hope somebody can help me out.

EDIT: i'm using Titanium 1.4.3

— asked December 4th 2010 by Wouter De Loose
  • iphone
1 Comment
  • Wouter, (sigh), please state your the Ti SDK you are using. A convenient way to do this is simply to add it to the question tags when you create the question.

    — commented December 4th 2010 by Paul Dowsett

4 Answers

  • http://developer.appcelerator.com/question/1011/how-do-i-add-a-title-barnavbar-to-the-main-window

    I found this solution before, but is this a good one?
    It looks like a dirty workaround.

    — answered December 4th 2010 by Wouter De Loose
    permalink
    0 Comments
  • Wouter

    Try setting the fullscreen:false or navBarHidden:false properties on the window.

    Cheers

    — answered December 4th 2010 by Paul Dowsett
    permalink
    1 Comment
    • I've tried them both before, and neither of them are working.

      Tried them with and without opening it as a modal window.

      — commented December 4th 2010 by Wouter De Loose
  • EDIT: double post.

    — answered December 4th 2010 by Wouter De Loose
    permalink
    0 Comments
  • So I went with this solution (http://developer.appcelerator.com/question/1011/how-do-i-add-a-title-barnavbar-to-the-main-window), but for some reason I can't give the title bar an image:

    var mainWindow = Ti.UI.createWindow({
        url: 'main.js',
        barImage: "assets/titleBarBg.png",
        title: "main",
        tabBarHidden: true
    });
    

    It only works when I manually do it in the open event of my main.js

    — answered December 4th 2010 by Wouter De Loose
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.