gpt4 book ai didi

ios - 使用 Floaty 库显示矩形按钮

转载 作者:行者123 更新时间:2023-11-29 05:56:22 24 4
gpt4 key购买 nike

我正在使用 Floaty 库(This 一个)来使用 float 按钮。它确实也像这样正确地显示了 float 按钮

enter image description here

但我希望 float 按钮看起来像这样......

enter image description here

这里标题为“Contribute”的黄色按钮是我想要从 Floaty 得到的

最佳答案

这里需要为Floaty设置两个属性

floaty.buttonImage = UIImage(named: "yourimage") //this will set your image
floaty.paddingX = self.view.frame.width/2 - floaty.frame.width/2 //this will set it to center.

点击此按钮时还会发生旋转,因此您需要转到 Floaty 类,然后搜索下面的行并对其进行注释。

self.plusLayer.transform = CATransform3DMakeRotation(self.degreesToRadians(self.rotationDegrees), 0.0, 0.0, 1.0)
self.buttonImageView.transform = CGAffineTransform(rotationAngle: self.degreesToRadians(self.rotationDegrees))

self.plusLayer.transform = CATransform3DMakeRotation(self.degreesToRadians(0), 0.0, 0.0, 1.0)
self.buttonImageView.transform = CGAffineTransform(rotationAngle: self.degreesToRadians(0))

关于ios - 使用 Floaty 库显示矩形按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55116564/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com