AladinWay / TransitionButton

UIButton sublass for loading and transition animation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto Layout messes up spinner alignment?

jh97uk opened this issue · comments

commented

Loving the library! Only thing is, when using Auto Layout constraints, it appears as though the spinner completely miss-aligns like so:
https://i.imgur.com/K0o9vYi.png

Heres my constraints on the button in Interface Builder:

https://i.imgur.com/JqJK8P4.png

commented

@JamesHealdUK I ran into the same issue when I programmatically initialized and added autolayout constraints to the button.

As far as I know, the button doesn't reconfigure the SpinerLayer's frame when it's superview's (the TransitionButton) frame is modified - by autolayout, in our cases. A simple workaround I found to solve this issue for my case is to initialize the button's size to a value that would be consistent with the value after it is updated by it's autolayout constraints.

I see that you've added constraints to set the size of the button proportional to it's superview. If you could set the size to a constant value, that might solve your problem. Or you could try to fork the repository and update the SpinerLayer's frame when its superview's frame is updated.

For me the spinner doesn't show at all when I use autolayout. Can this be fixed?

Thank you for reporting the issue. I will investigate the issue and apply a fix if needed.

It should be fixed in v0.4.0. Feel free to open the issue if you still have a problem.