시도 뭔가,
func showPickerView(_ animated: Bool) {
weak var weakSelf = self
UIView.animate(withDuration: (animated ? kPickerView_AppearanceAnimationDuration : 0.0), delay: (animated ? kPickerView_AppearanceAnimationDelay : 0.0), options: (animations as! UIViewAnimationOptionCurveEaseInOut), {() -> Void in
weakSelf!.pickerViewContainerView.transform = CGAffineTransform(translationX: 0, y: 0)
}, completion: {(finished: Bool) -> Void in
weakSelf!.view.layoutIfNeeded()
})
}
func hidePickerView(_ animated: Bool) {
weak var weakSelf = self
UIView.animate(withDuration: (animated ? kPickerView_DisappearanceAnimationDuration : 0.0), delay: (animated ? kPickerView_DisappearanceAnimationDelay : 0.0), options: (animations as! UIViewAnimationOptionCurveEaseInOut), {() -> Void in
weakSelf!.pickerViewContainerView.transform = CGAffineTransform(translationX: 0, y: kPickerView_Height)
}, completion: {(finished: Bool) -> Void in
그것은 나를 위해 작동합니다.
출처
2016-10-13 12:10:39
KAR
고맙지 만 같은 문제가 있습니다. – ilan
PickerView에 대해 설정된 제약 조건은 무엇입니까? –
꼬리 끌기, 선행, 높이, 위쪽, 아래쪽 – ilan