나는 visualEffect를 iOS10 및 이전 버전에서 잘 작동하는보기에 추가하려고 시도하지만 iOS 11에서는 충돌이 발생합니다.UIVisualEffectView LoadVIew()
has been added as a subview to <UIVisualEffectView: 0x7feabe90d170; frame = (0 0; 375 812); layer = <CALayer: 0x6000006257c0>>. Do not add subviews directly to the visual effect view itself, instead add them to the -contentView."
나는 다음과 같은 코드를 사용하고 있습니다 : 오류 이유는 아래와 같습니다 나는 그것이 충돌을 통과하는 것 viewDidLoad에이 코드를 추가 할 때 이상한 것은이
override func loadView() {
super.loadView()
// create the blur view
let blurView = UIVisualEffectView(effect: effect)
if let oldView = view {
blurView.frame = view.frame
oldView.translatesAutoresizingMaskIntoConstraints = false
blurView.contentView.addSubview(oldView)
blurView.contentView.pinParentAllDirections(oldView)
}
view = blurView
}
에게 ... 아무도 나를 도와주세요 주요한 문제를 이해했거나 iOS11의 내용을 놓친 것입니다.
아니요 .. 전적으로 코드에서 왔습니다. –
@Hani Ibrahim이 제안한 super.loadView()를 제거해 보셨습니까? – Rishi
나는 지금 당장했지만 .. 어떤 이유로 든 loadView() 내부의 무한 루프에 들어갔다. –