我有一个iphoneX特定的问题。有一个包含2个部分的集合视图,我要添加子视图,该子视图仅在您将最后一个部分向下拖动时才出现。
但是在iPhoneX上它始终可见,这不是我想要的。我该如何解决?
那是应该的样子(其他显示)
我的子视图代码:
func setupGenres() {
genreView.frame.size = CGSize(width: view.frame.size.width, height: view.frame.width / 7)
genreView.frame.origin.x = -2 // = 0
genreView.frame.origin.y = collectionView.frame.size.height / 3 - genreView.frame.size.height
genreView.backgroundColor = UIColor.clear
genreView.alpha = 1
collectionView.addSubview(genreView)
featuredGenre.frame.size = CGSize(width: view.frame.size.width / 5.75, height: view.frame.size.width / 15)
featuredGenre.frame.origin.x = view.frame.size.width / 29.57
pickView.frame.size = CGSize(width: featuredGenre.frame.size.width * 1.25, height: featuredGenre.frame.size.height * 1.2)
pickView.center.x = featuredGenre.center.x
pickView.frame.origin.y = genreView.frame.size.height / 2 - pickView.frame.size.height / 2
pickView.backgroundColor = UIColor.white
pickView.layer.cornerRadius = pickView.frame.size.height / 2
genreView.addSubview(pickView)
... and so on with other subviews
}
可能是什么问题?