【发布时间】:2016-02-17 19:02:03
【问题描述】:
我想在UIViewController 的中心放置一个对象。我曾尝试使用frame.width/2 和frame.height/2,例如UIView:
let newView = UIView(frame: CGRect(x: frame.width/2, y: frame.height/2, width: 100, height: 100))
该方法没有像我预期的那样将对象定位在视图的中心。如何使用 iPhone 6s 的 x-y 坐标将对象定位到视图的中心?
【问题讨论】:
标签: ios swift uiview coordinates