Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
a7f285d7
Commit
a7f285d7
authored
Dec 24, 2014
by
Felix Paul Kühne
Browse files
frosted glass: allow initialization from code instead of xib file
parent
5c75d452
Changes
1
Hide whitespace changes
Inline
Side-by-side
Sources/VLCFrostedGlasView.m
View file @
a7f285d7
...
...
@@ -2,7 +2,7 @@
* VLCFrostedGlasView.m
* VLC for iOS
*****************************************************************************
* Copyright (c) 2013 VideoLAN. All rights reserved.
* Copyright (c) 2013
-2014
VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <nitz.carola # googlemail.com>
...
...
@@ -21,26 +21,40 @@
@implementation
VLCFrostedGlasView
-
(
id
)
initWithCoder
:(
NSCoder
*
)
aDecoder
{
self
=
[
super
initWithCoder
:
aDecoder
];
if
(
self
)
{
[
self
setClipsToBounds
:
YES
];
if
(
SYSTEM_RUNS_IOS7_OR_LATER
)
{
if
(
!
[
self
toolbar
])
{
[
self
setToolbar
:[[
UIToolbar
alloc
]
initWithFrame
:[
self
bounds
]]];
[
self
.
layer
insertSublayer
:[
self
.
toolbar
layer
]
atIndex
:
0
];
[
self
.
toolbar
setBarStyle
:
UIBarStyleBlack
];
}
}
else
{
if
(
!
[
self
imageview
])
{
[
self
setImageview
:[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:
@"playbackControllerBg"
]]];
[
self
insertSubview
:
self
.
imageview
atIndex
:
0
];
}
if
(
self
)
[
self
setupView
];
return
self
;
}
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
[
self
setupView
];
return
self
;
}
-
(
void
)
setupView
{
[
self
setClipsToBounds
:
YES
];
if
(
SYSTEM_RUNS_IOS7_OR_LATER
)
{
if
(
!
[
self
toolbar
])
{
[
self
setToolbar
:[[
UIToolbar
alloc
]
initWithFrame
:[
self
bounds
]]];
[
self
.
layer
insertSublayer
:[
self
.
toolbar
layer
]
atIndex
:
0
];
[
self
.
toolbar
setBarStyle
:
UIBarStyleBlack
];
}
}
else
{
if
(
!
[
self
imageview
])
{
[
self
setImageview
:[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:
@"playbackControllerBg"
]]];
[
self
insertSubview
:
self
.
imageview
atIndex
:
0
];
}
}
return
self
;
}
-
(
void
)
layoutSubviews
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment