저녁,iOS Swift : 화면에서 제약 조건이 업데이트되지 않았습니다.
scrollview 제약 조건에 문제가 있습니다. 제약 일정이 업데이트되도록,
// when the keyboard is shown, move up some elements
@objc func keyboardWillShow(notification: NSNotification) {
if let keyboardSize = (notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue {
// Bring up the scrol lview
print(scrollViewBottomConstraint.constant)
self.scrollViewBottomConstraint.constant = keyboardSize.height
print(scrollViewBottomConstraint.constant)
self.view.updateConstraints()
self.view.updateConstraintsIfNeeded()
self.view.needsUpdateConstraints()
self.view.layoutIfNeeded()
// Bring up the next arrow with animation
self.nextButtonBottomConstraint.constant = keyboardSize.height + 8
UIView.animate(
withDuration: 1.0,
delay: 0.0,
usingSpringWithDamping: 0.5,
initialSpringVelocity: 6.0,
options: [.allowUserInteraction,
.curveEaseInOut],
animations: {
self.view.layoutIfNeeded()
}, completion: nil)
}
}
콘솔 인쇄 0 이상 253 :
이 내 코드입니다. 그러나 화면 I의 변화를 볼 수 있으며, I는이 로그를 가지고
[스냅 숏 적어도 한번 렌더링 afterScreenUpdates이 필요하지 않은 도면 (0x7fa041471bc0, UIInputSetHostView)를 스냅 숏 : YES.
는 u는 문제가 해결 되었습니까 :
는이 시도
은 제거하려고? – alegelos