我正在使用SwiftCharts for Swift 4。我还不知道如何让简单的图形正确显示,无论是在横向启动应用程序,还是处理从纵向到横向的旋转。有没有人能告诉我如何处理非肖像实现的例子或文档?
提前感谢
发布于 2018-03-20 21:22:21
在RangedAxisExample里找到了这个。
let orientation = UIApplication.shared.statusBarOrientation
guard (lastOrientation.map{$0.rawValue != orientation.rawValue} ?? true) else {return}
lastOrientation = orientation
guard let chart = chart else {return}
for view in chart.view.subviews {
view.removeFromSuperview()
}
self.drawChart() // my chart code here
chart.view.setNeedsDisplay()https://stackoverflow.com/questions/49370594
复制相似问题