mailiverse/cpp/iOS/Mailiverse/Components/UITransparentToolbar.m

44 lines
827 B
Mathematica
Raw Normal View History

2013-07-25 22:51:23 -04:00
/**
* Author: Timothy Prepscius
* License: BSD + keep my name in the code!
*/
#import "UITransparentToolbar.h"
// http://stackoverflow.com/questions/2468831/couldnt-uitoolbar-be-transparent
@implementation UITransparentToolbar
// Override draw rect to avoid
// background coloring
- (void)drawRect:(CGRect)rect {
// do nothing in here
}
// Set properties to make background
// translucent.
- (void) applyTranslucentBackground
{
self.backgroundColor = [UIColor clearColor];
self.opaque = NO;
self.translucent = YES;
}
// Override init.
- (id) init
{
self = [super init];
[self applyTranslucentBackground];
return self;
}
// Override initWithFrame.
- (id) initWithFrame:(CGRect) frame
{
self = [super initWithFrame:frame];
[self applyTranslucentBackground];
return self;
}
@end