茆閔智
茆閔智
Nov 6 · 3 min read

顯示文字的 UILabel

Line Break

Clip: 過長的文字,直接裁掉後方的文字

Character Wrap: lable顯示多行時,每行最後是以「字母」為單位來斷句,僅適用英文

Word Wrap: lable顯示多行時,每行最後是以「單字」為單位來斷句,僅適用英文

Truncate Head:裁掉前方的文字,以 … 代替

Truncate Middle:裁掉中間的文字,以 … 代替

Truncate Tail:裁掉後方的文字,以 … 代替

Auto-shrink

Fixed Font Size: 依設定好的規格來顯示文字(當文字超過時 會以上面Line Break 的設定為主)

Minimum Font Scale:當顯示文字太長時,系統會將文字縮小依比例縮小,範圍為0至1。

Minimum Font Size:當顯示文字太長時,系統會將文字依Font Size縮小,最小數值為1,最大不超過文字設定Font的大小。

Shadow (文字的陰影)

Github連結:

    茆閔智

    Written by

    茆閔智

    彼得潘的 Swift iOS App 開發教室

    學習 Swift iOS App 開發的學生作品集

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade