VCFloatingActionButton
VCFloatingActionButton copied to clipboard
Action buttons move up when the add/plus button is clicked
I use the action buttons on a scrollview but when i click the plus button, all sub-buttons appear but they are translated upward. What might be causing this? Thanks!
Can you post a screenshot ?
Even when i dont add the "Related Content" button and Ad view at the bottom, the flaoting action buttons still move.
Ok, let me check, are you using swift ? Cos i havent tested it out in swift
I'm using Objective-C. And the value for withScrollView is a webview's scrollview.
withScrollview:self.webView.scrollView
Hi @gizmoboy7! Any update on this? Thanks!
Got the same issue after changed UINavigationBar backgroundImage. Add below code and issue happens:
UINavigationBar *navBar = [[self navigationController] navigationBar];
UIImage *backgroundImage = [UIImage imageNamed:@"MyNavigationBarBackground"];
[navBar setBackgroundImage:backgroundImage forBarMetrics:UIBarMetricsDefault];
I could fix this issue in my project using:
In My ViewController.m I remove the NavigationBar and StatusBar height size.
CGRect frame = CGRectMake(size.width - FAB_SIZE - MARGIN,
size.height - FAB_SIZE - MARGIN - navBarHeight - statusBarHeight,
FAB_SIZE,
FAB_SIZE);
I defined a new method in the VCFloatingActionButton.h
-(id)initWithFrame:(CGRect)frame
normalImage:(UIImage*)passiveImage
andPressedImage:(UIImage*)activeImage
withScrollview:(UIScrollView*)scrView
andNavigationBar:(UINavigationBar*)navBar;
and Here the implementation of the new Method in VCFloatingActionButton.m
-(id)initWithFrame:(CGRect)frame
normalImage:(UIImage*)passiveImage
andPressedImage:(UIImage*)activeImage
withScrollview:(UIScrollView*)scrView
andNavigationBar:(UINavigationBar*)navBar {
self = [self initWithFrame:frame normalImage: passiveImage andPressedImage:activeImage withScrollview:scrView];
if(navBar) {
int statusBar = [UIApplication sharedApplication].statusBarFrame.size.height;
_buttonView.frame = CGRectMake(frame.origin.x,
frame.origin.y + navBar.frame.size.height + statusBar,
frame.size.width,
frame.size.height);
_menuTable.frame = CGRectMake(SCREEN_WIDTH/4,
0,
0.75*SCREEN_WIDTH,
SCREEN_HEIGHT - (SCREEN_HEIGHT - CGRectGetMaxY(self.frame) - navBar.frame.size.height - statusBar));
}
return self;
}