Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 클린 코드
- 애니메이션
- combine
- UICollectionView
- clean architecture
- ios
- collectionview
- 리펙토링
- Xcode
- Protocol
- Refactoring
- MVVM
- scrollview
- UITextView
- Human interface guide
- ribs
- swift documentation
- tableView
- SWIFT
- 리팩토링
- 스위프트
- swiftUI
- rxswift
- uitableview
- RxCocoa
- HIG
- map
- Clean Code
- uiscrollview
- Observable
Archives
- Today
- Total
김종권의 iOS 앱 개발 알아가기
[iOS - swift] UILabel 글자 크기 자동 줄이기 (autoshrink, minimum font scale, minimim font size, adjustsFontSizeToFitWidth) 본문
iOS 기본 (swift)
[iOS - swift] UILabel 글자 크기 자동 줄이기 (autoshrink, minimum font scale, minimim font size, adjustsFontSizeToFitWidth)
jake-kim 2020. 11. 20. 00:30
오토레이아웃에 의해 내부 UILabel의 문구가 "..."으로 잘리는 현상 해결방법
- autoshrink에서 사용 가능 (줄어들을 수 있는 한계치를 설정가능)


- 0.5배 작아질 수 있는 옵션 선택하여 해결


- 코드 베이스로 적용하고 싶다면, adjustsFontSizeToFitWidth 사용
label.numberOfLines = 1
label.adjustsFontSizeToFitWidth = true
label.minimumScaleFactor = 0.7 // 줄어들수 있는 비율을 의미. 0~1값.
'iOS 기본 (swift)' 카테고리의 다른 글
[iOS - swift] intrinsic content size (0) | 2020.11.21 |
---|---|
[iOS - swift] UILabel 문자열 길이 줄이는 스타일 (Line break, Truncate) (0) | 2020.11.20 |
[iOS - swift] clipsToBounds vs mastkToBounds (0) | 2020.11.20 |
[iOS - swift] init(frame:), required init?(coder aDecoder: NSCoder), prepareForInterfaceBuilder(), awakeFromNib() 초기화의 정체 (0) | 2020.11.16 |
[iOS - swift] 버튼의 상태 selected vs highlighted (0) | 2020.11.16 |