【发布时间】:2019-03-12 07:56:19
【问题描述】:
【问题讨论】:
-
普通的 UI Button 怎么样?
-
如果你想按你的要求按钮,你需要在你的浮动库中进行更改。表示高度、宽度和位置
-
True @iOSTeam 但这就是我无法弄清楚的……:)
标签: ios swift floating-action-button
【问题讨论】:
标签: ios swift floating-action-button
这里需要为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))
【讨论】: