Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. imgHorizon = UIImage.init(named:"horizon")!
  2. imgBezel = UIImage.init(named:"bezel_transparent")!
  3. imgWings = UIImage.init(named:"wings_transparent")!
  4.  
  5. imgViewHorizon = UIImageView.init()
  6. imgViewBezel = UIImageView.init()
  7. imgViewWings = UIImageView.init()
  8.  
  9. svHorizon = UIScrollView.init()
  10.  
  11. super.init(coder: aDecoder)
  12.  
  13. imgViewHorizon = UIImageView(frame: CGRect(x: 0, y: 0, width: imgBezel.size.width, height: imgHorizon.size.height))
  14. imgViewHorizon.backgroundColor = UIColor.red
  15.  
  16. imgViewBezel = UIImageView(frame: CGRect(x: 0, y: 0, width: imgBezel.size.width, height: imgBezel.size.height))
  17. imgViewBezel.contentMode = UIViewContentMode.center
  18. imgViewBezel.clipsToBounds = true
  19. imgViewBezel.image = imgBezel
  20.  
  21. imgViewWings = UIImageView(frame: CGRect(x: 0, y: 0, width: imgBezel.size.width, height: imgBezel.size.height))
  22. imgViewWings.contentMode = UIViewContentMode.center
  23. imgViewWings.clipsToBounds = true
  24. imgViewWings.image = imgWings
  25.  
  26. svHorizon = UIScrollView(frame: CGRect(x: 0, y: 0, width: imgBezel.size.width, height: imgBezel.size.width))
  27. svHorizon.contentSize = CGSize(width: imgBezel.size.width, height: imgHorizon.size.height)
  28. svHorizon.contentMode = UIViewContentMode.scaleToFill
  29. svHorizon.bounces = false
  30. svHorizon.backgroundColor = UIColor.cyan
  31. svHorizon.contentOffset = CGPoint(x: 0, y: 0)
  32.  
  33. svHorizon.addSubview(imgViewHorizon)
  34. addSubview(svHorizon)
  35. addSubview(imgViewBezel)
  36. addSubview(imgViewWings)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement