[英]iPhone Xs Max: AVCaptureVideoPreviewLayer when added to sublayer of View occupies less than the safe area of the iphone x - why?
[英]Why is the table view different size from iPhone X~iPhone XS Max?
在情节提要中,我以全尺寸填充表格视图。
我将占位符视图高度设置为这样。
self.placeholderView.frame.size.height = self.mainTableView.frame.height
如果我启动iPhone se〜iPhone 8 Plus,效果很好。
但是,如果我推出iPhone X〜iPhone Xs Max,则体积很小。
即使在iPhone X的情况下,表格视图本身也是完整尺寸。 但是,为什么我在获得表格视图时会得到不同的大小?
如何解决?
您应该改用这个
self.table.backgroundView = yourView()
如果您想将数据设置回表中,只需设置
if table.backgroundView != nil{
table.backgroundView = nil
}
我不知道您是否喜欢这个想法,但是每次将背景表格视图更改为显示无数据或没有互联网连接的用户时,我都会使用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.