Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private func setupBackgroundImage() {
- backgroundImageView = UIImageView(frame: bounds)
- addSubview(backgroundImageView)
- backgroundImageView.contentMode = .scaleAspectFill
- backgroundImageView.clipsToBounds = true
- backgroundImageView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
- }
- private func setupGradient() {
- gradientView = GradientView(frame: CGRect(x: 0, y: bounds.height, width: bounds.width, height: -60.0))
- addSubview(gradientView)
- gradientView.gradientLayer.colors = [
- UIColor.black.withAlphaComponent(0.0).cgColor,
- UIColor.black.withAlphaComponent(0.7).cgColor
- ]
- gradientView.autoresizingMask = [.flexibleWidth, .flexibleTopMargin]
- }
- private func setupLabel() {
- label = UILabel(frame: CGRect.zero)
- addSubview(label)
- label.font = UIFont.boldSystemFont(ofSize: 24.0)
- label.textColor = .white
- label.translatesAutoresizingMaskIntoConstraints = false
- NSLayoutConstraint.activate(
- [
- label.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16.0),
- label.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -16.0),
- label.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -8.0)
- ]
- )
- }
Add Comment
Please, Sign In to add comment