Warning from iOS “Do not add subviews directly to the visual effect view itself”

前端 未结 3 1888
春和景丽
春和景丽 2021-01-05 16:23

I have a function below and when I link with the iOS 11 SDK, I get an error:

Do not add subviews directly to the visual effect view itself, instead ad

3条回答
  •  感情败类
    2021-01-05 16:43

    Just follow what the error says and add your subviews to UIVisualEffectView's contentView.

    effectView.contentView.addSubview(activityIndicator)
    effectView.contentView.addSubview(strLabel)
    

提交回复
热议问题