teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

コメント追加

2018/05/07 12:57

投稿

nakatsu6723
nakatsu6723

スコア38

title CHANGED
File without changes
body CHANGED
@@ -11,6 +11,7 @@
11
11
 
12
12
  override func viewDidLoad() {
13
13
  super.viewDidLoad()
14
+ // ここでViewを作成し、初期のAutoLayoutを付けています。
14
15
  self.applyView = UINib(nibName: "ApplyView", bundle: nil).instantiate(withOwner: self, options: nil)[0] as! ApplyView
15
16
  view.addSubview(self.applyView)
16
17
  self.applyView.translatesAutoresizingMaskIntoConstraints = false
@@ -49,6 +50,7 @@
49
50
  guard let duration = userInfo[UIKeyboardAnimationDurationUserInfoKey] as? Double else {
50
51
  return
51
52
  }
53
+ // ここでキーボードの高さを取得、viewのbottomconstraintを変更しています。
52
54
  self.applyView.isHidden = false
53
55
  self.applyViewBottom?.constant = -keyboardInfo.cgSizeValue.height
54
56
  UIView.animate(withDuration: duration) {