Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11876] iOS 6: Drop shadow in navigation bar cannot be disabled through Titanium

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-10-07T20:35:17.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 21, 2013 Sprint 21 API, Release 3.2.0
ComponentsiOS
Labelsmodule_navbar, qe-closed-3.2.0, qe-testadded
ReporterPeter Varadi
AssigneeVishal Duggal
Created2012-10-10T09:09:43.000+0000
Updated2013-11-07T19:14:57.000+0000

Description

*Feature description* iOS 6 automatically adds drop shadow to the navigation bar that cannot be disabled through Titanium (2.1.3). *Proposed solution* See the objective-c solution here: http://stackoverflow.com/questions/11084331/how-do-i-disable-the-navigation-bar-shadow-in-ios-6-for-navigation-bars-with-cus controller.navigationBar.shadowImage = [[[UIImage alloc] init] autorelease]; controller is a UINavigationController. This should driven by a Property that we can enable disable on Window(?) or on NavigationGroup. Whatever makes more sense.

Comments

  1. Sindre Sorhus 2012-10-17

    I could really use this. I'm doing a custom navbar with search and now it adds a shadow between them...
  2. Ian Tearle 2012-11-30

    Yep. I'd like the ability to remove this also. Wrecks my layout and design. Any possible quick fix?
  3. Wieger Jelsma 2013-02-05

    Did someone find a quick fix yet? That little drop shadow is annoying.
  4. Sindre Sorhus 2013-02-06

    Is this seriously still not fixed...
  5. Joseph Sachs 2013-02-19

    Interested in this feature as well. +1
  6. Sindre Sorhus 2013-05-07

    ping
  7. Pierre Hunault 2013-07-10

    I fixed this in an app I'm currently developing, here is the "how to": http://exygy.com/titanium-how-to-remove-navigation-bar-drop-shadow-in-ios-6/
  8. Sindre Sorhus 2013-08-19

    bump
  9. Vishal Duggal 2013-09-30

    Test Case
       /*
       Modes 
       0 - No customization
       1 - Bar Image Only 
       2 - Bar Image + Hide Shadow
       3 - Bar Image + Custom Shadow
       */
       
       
       var count = 0;
       
       function openListener(e) {
           count = count+1;
       }
       
       function closeListener(e) {
           count --;
       }
       
       function clickListener(e){
           nav.openWindow(genWin());    
       }
       
       function genWin()
       {
           var temp = count % 4;
           var win = Ti.UI.createWindow({
               backgroundColor:'white',
               title: 'MODE '+temp
           })
       
           var str = 'MODE = '+temp+'\n';
       
           if (temp > 0) {
               win.barImage = 'images/slider_orangebar.png'
               str += 'barImage = images/slider_orangebar.png\n';
           }
       
           if (temp == 3) {
               win.shadowImage = 'images/slider_orangebar.png'
               str += 'shadowImage = images/slider_orangebar.png\n'
           }
       
           if (temp == 2) {
               win.hideShadow = true;
               str += 'hideShadow = true'
           }
       
           var label = Ti.UI.createLabel({
               text:str
           })
       
           win.add(label);
       
           win.addEventListener('click',clickListener);
           win.addEventListener('open',openListener);
           win.addEventListener('close',closeListener);
       
           return win;
       }
       
       var nav = Ti.UI.iOS.createNavigationWindow({
           window:genWin(),
           orientationModes:[Ti.UI.PORTRAIT,Ti.UI.LANDSCAPE_LEFT,Ti.UI.LANDSCAPE_RIGHT]
       })
       
       nav.open();
       
  10. Vishal Duggal 2013-09-30

    Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/4750
  11. Olga Romero 2013-10-31

    Tested and verified the fix with: Titanium Studio, build: 3.2.0.201310310121 Titanium SDK, build: 3.2.0.v20131031141643 Xcode 5.0 CLI 3.2.0 iOS 6 and 7 Simlator Devices: iPhone5s iOS 7.0.2 iPad4 iOS 6.0.1 Navbars are displayed according to set modes

JSON Source