Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Demo/LIVBubbleMenu/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6751" systemVersion="14D87h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
</dependencies>
<scenes>
<!--LIVBubbleMenu-->
Expand All @@ -27,8 +27,8 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WUy-tb-32T">
<rect key="frame" x="250" y="90" width="100" height="30"/>
<state key="normal" title="Partial Menu">
<rect key="frame" x="181" y="90" width="239" height="30"/>
<state key="normal" title="Partial Menu with custom tint color">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
Expand Down
1 change: 1 addition & 0 deletions Demo/LIVBubbleMenu/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ - (IBAction)partialButtonTapped:(id)sender {
_bubbleMenu.easyButtons = NO;
_bubbleMenu.bubbleStartAngle = 0.0f;
_bubbleMenu.bubbleTotalAngle = 180.0f;
_bubbleMenu.bubbleTintColor = [UIColor greenColor];
[_bubbleMenu show];
}

Expand Down
1 change: 1 addition & 0 deletions LIVBubbleMenu/LIVBubbleMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
@property (nonatomic, assign) float bubblePopOutDuration; // The amount of seconds it takes for a bubble to reach its hide position (default is 1.0f)
@property (nonatomic, assign) float bubbleStartAngle; // Initial angle to start bubbles (default is 0.0f)
@property (nonatomic, assign) float bubbleTotalAngle; // Total available degrees in the bubble menu (default is 360)
@property (nonatomic, assign) UIColor *bubbleTintColor; // Tint color for bubble images
@property (nonatomic, assign) BOOL easyButtons; // simple or complex button styling (set NO if buttons have alpha channel) (default is YES);

// Background
Expand Down
8 changes: 8 additions & 0 deletions LIVBubbleMenu/LIVBubbleMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ -(UIButton*)createButtonWithImage:(UIImage *)image
button.frame = CGRectMake(0, 0, 2 * _bubbleRadius, 2 * _bubbleRadius);

if (_easyButtons) {
if (_bubbleTintColor) {
image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[button setTintColor:_bubbleTintColor];
}
[button setImage:image forState:UIControlStateNormal];
} else {
// Circle background
Expand All @@ -326,6 +330,10 @@ -(UIButton*)createButtonWithImage:(UIImage *)image

// Circle icon
UIImageView *icon = [[UIImageView alloc] initWithImage:image];
if (_bubbleTintColor) {
[icon setTintColor:_bubbleTintColor];
icon.image = [icon.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
}
CGRect f = icon.frame;
f.origin.x = (CGFloat) ((circle.frame.size.width - f.size.width) * 0.5);
f.origin.y = (CGFloat) ((circle.frame.size.height - f.size.height) * 0.5);
Expand Down