Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. for peop in personArray{
  2.  
  3. scrollView.clearContent ??????
  4.  
  5.  
  6. // Name label
  7. var label: UILabel = UILabel()
  8. label.frame = CGRectMake(8, CGFloat(nameHeight), 183, 21)
  9. label.backgroundColor = UIColor.whiteColor()
  10. label.textColor = UIColor(red: 90/255.0, green: 187/255.0, blue: 206/255.0, alpha: 1.0)
  11. label.textAlignment = NSTextAlignment.Left
  12. label.font = UIFont (name: "HelveticaNeue-Light", size: 14)
  13. label.text = " (peop.getName()) - (sex)"
  14. self.scrollView.addSubview(label)
  15.  
  16.  
  17. //Delete button
  18. var button = UIButton.buttonWithType(UIButtonType.System) as UIButton
  19. button.tag = playerId
  20. button.frame = CGRectMake(199, CGFloat(nameHeight), 37, 21)
  21. button.backgroundColor = colorWheel.colorsArray[7]
  22. button.setTitle("Slet", forState: UIControlState.Normal)
  23. button.addTarget(self, action: "delAction:", forControlEvents: UIControlEvents.TouchUpInside)
  24. button.setTitleColor(UIColor.whiteColor(), forState: UIControlState.Normal)
  25. self.scrollView.addSubview(button)
  26. button.titleLabel!.font = UIFont(name: "HelveticaNeue-Light", size: 14)
  27.  
  28.  
  29. scrollHeight = scrollHeight + 29
  30. nameHeight = nameHeight + 29
  31. playerId++
  32. }
  33. scrollView.contentSize = CGSize(width: 20.0, height: CGFloat(nameHeight))
  34. }
  35.  
  36. func delAction(sender: UIButton!){
  37. personArray.removeAtIndex(sender.tag)
  38. updatePeople()
  39. }
  40.  
  41. let subViews = self.scrollView.subviews
  42. for subview in subViews{
  43. subview.removeFromSuperview()
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement