mirror of
https://github.com/moparisthebest/mailiverse
synced 2024-11-14 13:15:03 -05:00
44 lines
827 B
Objective-C
44 lines
827 B
Objective-C
/**
|
|
* 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
|