Closed nauynix closed 5 years ago
Hi, you can implement 'onboardingConfigurationItem' delegate method, and adding custom views to item at index.
You can have it like below.
func onboardingConfigurationItem(_ item: OnboardingContentViewItem, index: Int) {
// add custom background image
let tmp: Int = 500
// assume you have an array of uiimages
if item.viewWithTag(tmp + 1) == nil {
let imgView = UIImageView(image: backgroundImages[index])
imgView.tag = tmp + 1
imgView.contentMode = .scaleAspectFill
item.insertSubview(imgView, at: 0)
// for instance I like to have blur effect on my background images
let blurEffect = UIBlurEffect(style: .dark)
let blurOverlay = UIVisualEffectView(effect: blurEffect)
blurOverlay.alpha = 0.90
blurOverlay.frame = view.bounds
blurOverlay.autoresizingMask = [.flexibleWidth, .flexibleHeight]
imgView.addSubview(blurOverlay)
// I use SnapKit for auyolayout engine
// you can use whatever you want
// important thing is you must give full screen size as imageview frame size.
imgView.snp.remakeConstraints({ (make) in
make.size.equalTo(view.bounds.size)
})
blurOverlay.snp.remakeConstraints({ (make) in
make.edges.equalToSuperview()
})
}
}
how could you make the imageview the full frame size without having to import snapkit?
I want to have my own background in an image view. However, changing the alpha of the background colour to 0 in onboardingiteminfo seems to set it to white instead.