Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/118.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios SWRevealViewController-获取后视图的高度_Ios_Xcode_Swift3_Swrevealviewcontroller - Fatal编程技术网

Ios SWRevealViewController-获取后视图的高度

Ios SWRevealViewController-获取后视图的高度,ios,xcode,swift3,swrevealviewcontroller,Ios,Xcode,Swift3,Swrevealviewcontroller,我正在寻找一种获取后视图高度的方法,我需要它,因为我正在使用此代码显示和隐藏活动指示器: func showActivityIndicator() { DispatchQueue.main.async { self.loadingView = UIView() self.loadingView.frame = CGRect(x: 0.0, y: 0.0, width: self.view.frame.width, height: self.view

我正在寻找一种获取后视图高度的方法,我需要它,因为我正在使用此代码显示和隐藏活动指示器:

    func showActivityIndicator() {
    DispatchQueue.main.async {
        self.loadingView = UIView()
        self.loadingView.frame = CGRect(x: 0.0, y: 0.0, width: self.view.frame.width, height: self.view.frame.height)
        print("Width: \(self.revealViewController().view.frame.width)")
        print("Height: \(self.revealViewController().view.frame.height)")
        self.loadingView.center = self.view.center
        self.loadingView.backgroundColor = UIColor(rgba: "#111111")
        self.loadingView.alpha = 0.9
        self.loadingView.clipsToBounds = true


        self.spinner = UIActivityIndicatorView(activityIndicatorStyle: .whiteLarge)
        self.spinner.frame = CGRect(x: 0.0, y: 0.0, width: 80.0, height: 80.0)
        self.spinner.center = CGPoint(x:self.loadingView.bounds.size.width / 2, y:self.loadingView.bounds.size.height / 2)

        self.loadingView.addSubview(self.spinner)
        self.view.addSubview(self.loadingView)
        self.spinner.startAnimating()
    }
}

func hideActivityIndicator() {
    DispatchQueue.main.async {
        self.spinner.stopAnimating()
        self.loadingView.removeFromSuperview()
    }
}
但并没有在所有尺寸的后视图上显示活动,只是在设备的尺寸上

这里有两张上面和下面的照片

也许有另一种方法或建议,我可以用来解决它


谢谢您的帮助,

您是否尝试在中查找一些属性

self.swrevealviewcontroller.height
我很久以前就用过它,我记得有一个属性,我几乎可以肯定


希望有帮助

我使用的是
self.revealViewController().view.frame.height
,但它返回的是设备的高度,而不是后视图中滚动视图的高度