Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // superbgImageView - картинка на самом заднем фоне красном
- // imageHeader - лента красная
- // bgImageView - деревяшка фон которая лежит сразу на superbgImageView
- // regButton кнока create
- // frame - указывает координаты левого верхнего края
- // если у тебя все привязывается через центр объекта то просто прибавляй/вычитай половину размера из координат
- superbgImageView.frame = self.view.bounds
- imageHeader.frame = CGRect(x: w/2-w/3, y:h/24, width: 2*w/3, height: h/4)
- bgImageView.frame = CGRect(x: w/2-w/3, y: h/8, width: 2*w/3, height: 3*h/4)
- regButton.frame = CGRect(x: w/2-w/10, y: 3*h/4, width: w/5, height: h/5)
- loginTextField.frame = CGRect(x: w/2-w/8, y: h/4, width: w/4, height: h/8)
- passFTextField.frame = CGRect(x: w/2-w/8, y: h/4+h/6, width: w/4, height: h/8)
- passSTextField.frame = CGRect(x: w/2-w/8, y: h/4+h/3, width: w/4, height: h/8)
- errorMsgLabel.frame = CGRect(x: w/2-w/6, y: 2*h/3 , width: w/3, height: h/8)
- loginTextField.font = UIFont(name: "Marker Felt", size: h/16)
- passFTextField.font = UIFont(name: "Marker Felt", size: h/16)
- passSTextField.font = UIFont(name: "Marker Felt", size: h/16)
- let label = UILabel(frame: CGRect(x:0, y: -h/16, width: 2*w/3, height: h/4))
- label.textAlignment = .center
- label.textColor = #colorLiteral(red: 0.9529411793, green: 0.6862745285, blue: 0.1333333403, alpha: 1)
- label.text = "REGISTRATION"
- label.font = UIFont(name: "Marker Felt", size: h/10)
- /// теперь про меню
- loginLabel.frame = CGRect(x: 5, y: 5, width: w/6, height: h/8)
- loginLabel.font = UIFont(name: "Marker Felt", size: h/20)
- exitButton.frame = CGRect(x: w-h/10, y: 5 , width: h/10, height: h/10)
- superbgImageView.frame = self.view.bounds
- bgImageView.frame = CGRect(x: w/2-w/3, y: h/12, width: 2*w/3, height: 5*h/6)
- offlineMacthButton.frame = CGRect(x: w/2-w/8, y: h/6, width: w/4, height: h/6)
- onlineMacthButton.frame = CGRect(x: w/2-w/8, y: h/3+10, width: w/4, height: h/6)
- heroesButton.frame = CGRect(x: w/2-w/8, y: h/2+20, width: w/4, height: h/6)
- bookButton.frame = CGRect(x:3*w/4, y: 3*h/4, width: w/4, height: h/4)
- runeButton.frame = CGRect(x:0, y: 3*h/4, width: w/4, height: h/4)
- // тут добавляю надписи на кнопки
- // добавляю надписи не на саму вью а именно. как наследник кнопки
- var buttons = [offlineMacthButton,onlineMacthButton,heroesButton]
- var labels = [NSLocalizedString("КАМПАНИЯ", comment: ""),NSLocalizedString("ОНЛАЙН МАТЧ", comment: ""),NSLocalizedString("ГЕРОИ", comment: "")]
- for button in buttons {
- let label2 = UILabel(frame: CGRect(x:0, y: 0, width: w/4, height: h/6))
- label2.textAlignment = .center
- label2.textColor = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 1)
- label2.text = labels[cnt]
- cnt+=1
- label2.font = UIFont(name: "Marker Felt", size: h/20)
- label2.adjustsFontSizeToFitWidth = true
- button.addSubview(label2)
- }
- buttons = [bookButton,runeButton]
- labels = ["СПЕЛЛБУК","РУНЫ"]
- cnt = 0
- for button in buttons {
- let label2 = UILabel(frame: CGRect(x:0, y: h/13, width: w/4, height: h/4))
- label2.textAlignment = .center
- label2.textColor = #colorLiteral(red: 0.2094716728, green: 0.1004144028, blue: 0.1077578291, alpha: 1)
- label2.text = labels[cnt]
- cnt+=1
- label2.font = UIFont(name: "Marker Felt", size: h/20)
- label2.adjustsFontSizeToFitWidth = true
- button.addSubview(label2)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement