Floaty icon indicating copy to clipboard operation
Floaty copied to clipboard

Adding a UIView to the button

Open choujar opened this issue 5 years ago • 2 comments

Hi folks,

I'm trying to add a uiview (kinda like a counter) to the floating button, like this:

Screenshot 2019-06-24 19 43 48

But, instead I'm getting this:

WhatsApp Image 2019-06-24 at 7 42 25 PM

Even though, the Debug view hierarchy in xCode is showing me this:

Screenshot 2019-06-24 19 49 19

I'm using the following to add the UIView: Floaty.global.button.addSubview(floatingCounter!)

Anyone has any tips please?

choujar avatar Jun 24 '19 17:06 choujar

@choujar

floatingCounter.layer.zPosition = CGFloat.greatestFiniteMagnitude

Should fix that problem

ElSifi avatar Jul 21 '19 07:07 ElSifi

Hi @Badi3 - I actually fixed it by adding a separate UIView (with a UILabel inside) and dynamically placing it based on the position of the floating button. But I'll try your solution and get back to you!

Thanks!

choujar avatar Sep 22 '19 14:09 choujar