UIImageView bar transparency

Discussion in 'iOS Programming' started by nashyo, Jan 24, 2012.

  1. nashyo macrumors 6502

    nashyo

    Joined:
    Oct 1, 2010
    Location:
    Bristol
    #1
  2. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #2
    I was experimenting with this last year and still have some commented out code in the app. Anyway, I think this will lead you in the right direction. It's 4AM and I don't have time to test this.

    Looks like the status bar on top can use this.

    Code:
    [[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackTranslucent];

    For the navigation bar, one or both of these lines may be needed in your viewDidLoad method.

    Code:
    [[[self navigationController]  navigationBar] setBarStyle: UIBarStyleBlackTranslucent];
    [[[self navigationController]  navigationBar] setTranslucent: YES];
    

    For a UIToolBar it looks like this is what you want to look at.
    Code:
    [toolBar setBarStyle: UIBarStyleBlack];
    [toolBar setTranslucent: YES];

    iOS 5 has added the UIAppearance protocol which may be the new right way to affect those items. Looks like I played with that too. I have this line commented out in my AppDelegate.
    Code:
    [[UINavigationBar appearance] setBarStyle: UIBarStyleBlack]; //UIBarStyleBlackTranslucent];
     
  3. nashyo thread starter macrumors 6502

    nashyo

    Joined:
    Oct 1, 2010
    Location:
    Bristol
    #3
    thanks

    Thanks xStep. I'll try this when I get home from work.
     

Share This Page