当用户选择一个切片并让切片停止在轮子顶部时,我正在尝试旋转饼图轮
// start from the middle of the slice angle
let startAngle = self.slicesArray[index].angle / 2
// end at top of chart
let endAngle = //?
let angleDifference = //?
UIView.animateWithDuration(0.4, animations: {
self.transform = CGAffineTransformRotate(self.transform, -angleDifference)
})
你试过用 3/2 π 作为 endAngle 吗?区别显然是 endAngle - startAngle
关于ios - 如何计算饼图顶部的旋转角度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41672047/
欢迎光临 OGeek|极客世界-中国程序员成长平台 (https://ogeek.cn/) | Powered by Discuz! X3.4 |