Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout issues after application went to background #24

Closed
AnasMostefaoui opened this issue Mar 23, 2016 · 1 comment
Closed

Layout issues after application went to background #24

AnasMostefaoui opened this issue Mar 23, 2016 · 1 comment

Comments

@AnasMostefaoui
Copy link

Hello,
I'm using the KCFloatingActionButton (1.2.1) with items that have only icons and no text.
Every thing work well, as long as the application stay at foreground :
screen shot 2016-03-23 at 21 28 48

now if i go background (when i trigger [UIApplication sharedApplication] openURL: for exemple), wait few seconds, go back to the application from the application icon, this is the layout now :
screen shot 2016-03-23 at 21 28 59

notice that the KCFloatingActionButtonItem's method : drawRect, get called when i try to go back to the application, but this time the frame value did change in this line of createCircleLayer method :
circleLayer.frame = CGRectMake(frame.size.width - size, 0, size, size)

i did not find why the frame property chage it's value, but i got a work around to fix this issue :
replace the precedent line of code :
circleLayer.frame = CGRectMake(frame.size.width - size, 0, size, size)
by :
let castParent : KCFloatingActionButton = superview as! KCFloatingActionButton; circleLayer.frame = CGRectMake(castParent.itemSize/2 - (size/2), 0, size, size)
this give me a perfect centred item circle.

@kciter
Copy link
Owner

kciter commented Mar 25, 2016

Hello @AnasMostefaoui.
Solved on 1.3.0 version. Thanks.

@kciter kciter closed this as completed Mar 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants