我有程序創建這樣一個UIView:分割的圓形的UIView到5條相等角件
forecastWeatherWheel.backgroundColor = UIColor(red: 255/255, green: 255/255, blue: 255/255, alpha: 0.1)
forecastWeatherWheel.frame = CGRect(x: -(dailyWeatherContainer.frame.width + 100)/2,
y: self.view.bounds.height/2 - ((dailyWeatherContainer.frame.height + 100)/2),
width: dailyWeatherContainer.frame.width + 100,
height: dailyWeatherContainer.frame.height + 100)
forecastWeatherWheel.layer.cornerRadius = forecastWeatherWheel.bounds.size.width/2
forecastWeatherWheel.translatesAutoresizingMaskIntoConstraints = false
self.view.addSubview(forecastWeatherWheel)
我需要添加(再次編程)5子視圖此UIView的。 我努力尋找subViews的錨點的座標。
思考成度,我圈出來的superView必須分成72°,每個相等的部分,邊界的座標必須是我的子視圖的錨點。
見https://stackoverflow.com/questions/839899/how-do-i用於計算給定角度的圓上位置的圓周上的點。 – Gerriet