Swift로 UILabel의 수직 정렬
설치
pod "VerticalAlignmentLabel"
Storyboard 또는 XIB에서 UILabel을 붙여넣은 후
Class
및 Module
를 다음과 같이 변경합니다.
그런 다음 Attribute Inspector로 이동하여
Top
또는 Buttom
를 On으로 설정합니다.(* 양쪽 On이면
Bottom
가 됩니다.)
실행 결과

코드상의 지정이라면 이렇게 됩니다.
// var label: VerticalAlignmentLabel
label.verticalTextAlignment = .top
label.verticalTextAlignment = .center
label.verticalTextAlignment = .bottom
Reference
이 문제에 관하여(Swift로 UILabel의 수직 정렬), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/darquro/items/deac1e1f937d60c3ab42텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)