Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-493] implement background image for navbar

GitHub Issuen/a
Resolution Date2011-04-17T01:53:16.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.4.0
Labelsios, iphone, navbar
ReporterNolan Wright
AssigneeJeff Haynie


this was in 0.8 - just need to add it back to 0.9


  1. majman 2011-04-15

    Crossing my fingers that this doesn't get pushed to 1.4

  2. majman 2011-04-15

    ack! :(

  3. Jeff Haynie 2011-04-15

    (from [1c21cf4ddb0d2a3b1bcf7f385ea9bc2f1b3e4ba9]) Closes #493 . window now supports a barImage property, and the window_navbar.js has a button to reflect this new feature. http://github.com/appcelerator/titanium_mobile/commit/1c21cf4ddb0d2a3b1bcf7f385ea9bc2f1b3e4ba9"> http://github.com/appcelerator/titanium_mobile/commit/1c21cf4ddb0d2...

  4. Justin 2011-04-15

    When a window constructor url contains a subdirectory, the bar image url is relative to the subdirectory.

    My initial expectation was for the bar image url to be relative to the parent file (app.js) and not the sub-context (win1.js).

    If possible, having the url be relative to the parent may be a little more intuitive.

       // from within app.js
       var win2 = Ti.UI.createWindow({
       // this doesn't work
       win1.barImage = 'corkboard.jpg';
       // but this does
       win1.barImage = '../corkboard.jpg';
  5. Justin 2011-04-15

    When the bar image is defined in the constructor, it causes nav bar buttons to not display. Refreshing the nav bar area by changing tabs restores the buttons (and bar image).

  6. Justin 2011-04-15

    The title of an opening window's navbar normally fades and slides into view. When using a barImage, it appears to break this animation. Observations:

    1. When a new window uses a barImage, the title of the new window does not display. Workaround,: setTimeout 10 ms, set barImage to null, then to actual image and setTitle. This causes title to display, but without animation. Instead, it appears abruptly.

    2. If the new window does not use a barImage, the title is rendered, but again, without animation.

  7. Jeff Haynie 2011-04-15

    (from [a38ad774baa02dd59218a2aaf2a0216d31e4e550]) Closes #493 (again) -- Setting the nav button now will cause the barImage to refresh (and be properly located) and more so, setting the barImage causes the url to be resolved at assign time. http://github.com/appcelerator/titanium_mobile/commit/a38ad774baa02dd59218a2aaf2a0216d31e4e550"> http://github.com/appcelerator/titanium_mobile/commit/a38ad774baa02...

  8. Justin 2011-04-15

    Assign-time barImage url resolution works great. Thanks Blain!

    During a barImage'd window's opening animation, the title appears abruptly rather than sliding in from the left. Can you add support for this animation?

  9. Nolan Wright 2011-04-15

    re-opening see Justin's comment

  10. Stephen Tramer 2011-04-15

    This can actually be handled in the JS. You need to set the barImage when opening the window, NOT in the JS that lays out the window. Example:

        win = Titanium.UI.createWindow({
  11. Justin 2011-04-15

    I'm doing this, but it does not appear to be working. When I remove the barImage from both windows, upon opening the 2nd window, the title slides and fades in. Whereas without it, the title does not slide and simply appears.

  12. Stephen Tramer 2011-04-15

    Okay, it doesn't work when you have a different barImage set previously. I'm not sure we can have any control over this but will look at it.

  13. Justin 2011-04-15

    Appreciate you looking into it, thanks Stephen!

  14. Jeff Haynie 2011-04-15

    (from [3e56a1be575abe034f0062d68f7002e071136f03]) Closes #493: barImage backgrounds are removed from the view before focusing the new window. http://github.com/appcelerator/titanium_mobile/commit/3e56a1be575abe034f0062d68f7002e071136f03"> http://github.com/appcelerator/titanium_mobile/commit/3e56a1be575ab...

  15. Justin 2011-04-15

    That was impressively fast. Grazie!

  16. Justin 2011-04-15

    I hate to do this, but I noticed another possible issue. openPhotoGallery() causes the bar image to disappear.

  17. Stephen Tramer 2011-04-15

    This bug is getting too long and I don't want to reopen/rename it again. See #1091.

JSON Source