VLCFrostedGlasView.m 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*****************************************************************************
  2. * VLCFrostedGlasView.m
  3. * VLC for iOS
  4. *****************************************************************************
  5. * Copyright (c) 2013-2014 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Carola Nitz <nitz.carola # googlemail.com>
  9. *
  10. * Refer to the COPYING file of the official project for license.
  11. *****************************************************************************/
  12. #import "VLCFrostedGlasView.h"
  13. @interface VLCFrostedGlasView ()
  14. @property (nonatomic) UIToolbar *toolbar;
  15. @property (nonatomic) UIImageView *imageview;
  16. @end
  17. @implementation VLCFrostedGlasView
  18. - (id)initWithCoder:(NSCoder *)aDecoder
  19. {
  20. self = [super initWithCoder:aDecoder];
  21. if (self)
  22. [self setupView];
  23. return self;
  24. }
  25. - (instancetype)initWithFrame:(CGRect)frame
  26. {
  27. self = [super initWithFrame:frame];
  28. if (self)
  29. [self setupView];
  30. return self;
  31. }
  32. - (void)setupView
  33. {
  34. [self setClipsToBounds:YES];
  35. if (![self toolbar]) {
  36. [self setToolbar:[[UIToolbar alloc] initWithFrame:[self bounds]]];
  37. [self.layer insertSublayer:[self.toolbar layer] atIndex:0];
  38. [self.toolbar setBarStyle:UIBarStyleBlack];
  39. }
  40. }
  41. - (void)layoutSubviews {
  42. [super layoutSubviews];
  43. [self.toolbar setFrame:[self bounds]];
  44. }
  45. @end