Add a blurry background (#690)
This commit is contained in:
parent
77beff55d5
commit
1aa3a20997
|
@ -13,6 +13,7 @@ class WelcomeContentPageView: UIView {
|
||||||
private let contentStackView: UIStackView
|
private let contentStackView: UIStackView
|
||||||
private let titleView: UILabel
|
private let titleView: UILabel
|
||||||
private let label: UILabel
|
private let label: UILabel
|
||||||
|
private let blurryBackgroundView: UIVisualEffectView
|
||||||
|
|
||||||
init(page: WelcomeContentPage) {
|
init(page: WelcomeContentPage) {
|
||||||
|
|
||||||
|
@ -35,10 +36,16 @@ class WelcomeContentPageView: UIView {
|
||||||
contentStackView.axis = .vertical
|
contentStackView.axis = .vertical
|
||||||
contentStackView.alignment = .leading
|
contentStackView.alignment = .leading
|
||||||
contentStackView.spacing = 8
|
contentStackView.spacing = 8
|
||||||
|
|
||||||
|
blurryBackgroundView = UIVisualEffectView(effect: UIBlurEffect(style: .light))
|
||||||
|
blurryBackgroundView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
|
blurryBackgroundView.applyCornerRadius(radius: 8)
|
||||||
|
|
||||||
|
blurryBackgroundView.contentView.addSubview(contentStackView)
|
||||||
|
|
||||||
super.init(frame: .zero)
|
super.init(frame: .zero)
|
||||||
|
|
||||||
addSubview(contentStackView)
|
addSubview(blurryBackgroundView)
|
||||||
|
|
||||||
setupConstraints()
|
setupConstraints()
|
||||||
}
|
}
|
||||||
|
@ -47,10 +54,15 @@ class WelcomeContentPageView: UIView {
|
||||||
|
|
||||||
private func setupConstraints() {
|
private func setupConstraints() {
|
||||||
let constraints = [
|
let constraints = [
|
||||||
contentStackView.topAnchor.constraint(equalTo: topAnchor),
|
blurryBackgroundView.topAnchor.constraint(equalTo: topAnchor),
|
||||||
contentStackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16),
|
blurryBackgroundView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16),
|
||||||
trailingAnchor.constraint(equalTo: contentStackView.trailingAnchor, constant: 16),
|
trailingAnchor.constraint(equalTo: blurryBackgroundView.trailingAnchor, constant: 16),
|
||||||
bottomAnchor.constraint(equalTo: contentStackView.bottomAnchor)
|
bottomAnchor.constraint(greaterThanOrEqualTo: blurryBackgroundView.bottomAnchor),
|
||||||
|
|
||||||
|
contentStackView.topAnchor.constraint(equalTo: blurryBackgroundView.contentView.topAnchor, constant: 8),
|
||||||
|
contentStackView.leadingAnchor.constraint(equalTo: blurryBackgroundView.contentView.leadingAnchor, constant: 8),
|
||||||
|
blurryBackgroundView.contentView.trailingAnchor.constraint(equalTo: contentStackView.trailingAnchor, constant: 8),
|
||||||
|
blurryBackgroundView.contentView.bottomAnchor.constraint(equalTo: contentStackView.bottomAnchor, constant: 8),
|
||||||
]
|
]
|
||||||
|
|
||||||
NSLayoutConstraint.activate(constraints)
|
NSLayoutConstraint.activate(constraints)
|
||||||
|
|
Loading…
Reference in New Issue