5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/motion-floating-action-button/motion-floating-action-button.rb', line 5
def new( floating_frame,
options
)
normal_image = options[:normal_image] || UIImage.imageNamed('plus')
pressed_image = options[:pressed_image] || UIImage.imageNamed('plus')
navigation_bar = options[:navigation_bar]
scroll_view = options[:scroll_view]
if scroll_view && navigation_bar
addButton = VCFloatingActionButton.alloc.initWithFrame(floating_frame,
normalImage: normal_image,
andPressedImage: pressed_image,
withScrollview: scroll_view,
andNavigationBar: navigation_bar
)
elsif scroll_view
addButton = VCFloatingActionButton.alloc.initWithFrame(floating_frame,
normalImage: normal_image,
andPressedImage: pressed_image,
withScrollview: scroll_view,
)
elsif navigation_bar
addButton = VCFloatingActionButton.alloc.initWithFrame(floating_frame,
normalImage: normal_image,
andPressedImage: pressed_image,
andNavigationBar: navigation_bar
)
else
addButton = VCFloatingActionButton.alloc.initWithFrame(floating_frame,
normalImage: normal_image,
andPressedImage: pressed_image
)
end
addButton
end
|