无法在SWIFT上正确放大图表

时间:2019-05-10 21:56:01

标签: swift image-enlarge

当前,单击图形后,图形将覆盖屏幕的上半部分,而下半部分仅是彩色背景。在第二次触摸时,条形图一直一直位于视图下方。

我尝试更改尺寸,但未更改

@IBAction func enlargeChart(_ sender: UITapGestureRecognizer) {
    if (isFullscreen == false) {
        UIView.animate(withDuration: 0.75, animations: {() -> Void in
            let width = self.superView.frame.width
            let height = self.superView.frame.height
            let barWidth = self.barChartView.frame.width
            let barHeight = self.barChartView.frame.height
            let rect = CGRect(x: 0, y: 0, width: width, height: height)
            let rectBar = CGRect(x: 0, y: height, width: width, height: height)
            self.botView.frame = rect
            self.barChartView.frame = rectBar
        })
    }
}

0 个答案:

没有答案