1

I want to add a button or custom view on the status bar in the iPhone,

If apple not allow to customize the status bar than is it possible to add any button or view over the status bar...

Is there any one have idea about this please share with me.

Thanks

Pratik B
  • 1,599
  • 1
  • 15
  • 32
Mayur Prajapati
  • 5,454
  • 7
  • 41
  • 70

1 Answers1

4

Yo can get static library mimicing Reeders status bar overlay, you can find it here

MTStatusBarOverlay

Or Just create a simple subclass of UIWindow with the following override of initWithFrame:

@interface ACStatusBarOverlayWindow : UIWindow {
}
@end

@implementation ACStatusBarOverlayWindow
- (id)initWithFrame:(CGRect)frame {
    if ((self = [super initWithFrame:frame])) {
        // Place the window on the correct level and position
        self.windowLevel = UIWindowLevelStatusBar+1.0f;
        self.frame = [[UIApplication sharedApplication] statusBarFrame];

        // Create an image view with an image to make it look like a status bar.
        UIImageView *backgroundImageView = [[UIImageView alloc] initWithFrame:self.frame];
        backgroundImageView.image = [[UIImage imageNamed:@"statusBarBackgroundGrey.png"] stretchableImageWithLeftCapWidth:2.0f topCapHeight:0.0f];
        [self addSubview:backgroundImageView];
        [backgroundImageView release];

        // TODO: Insert subviews (labels, imageViews, etc...)
    }
    return self;
}
@end

For More Information see this Link...

adding-view-on-statusbar-in-iphone

i hope this help you...

Community
  • 1
  • 1
Paras Joshi
  • 20,427
  • 11
  • 57
  • 70