I'm dynamically populating the title (UILabel). Sometime it's bit too long and IOS squeeze the font to fit in the width. Is there a way to do multiline with using same font size?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
Use
UILabel
properties as below :Yes, you set the
numberOfLines
to 0, and the.lineBreakMode
toUILineBreakModeWordWrap
in code, or the equivalents if your label is defined in IB.Set
adjustsFontSizeToFitWidth
to NO andnumberOfLines
to 0.numberOfLines Docs
You may additionally want to specify the
lineBreakMode
unless the defaultUILineBreakModeWordWrap
is suitable for what you want.I just used LineBreak mode to Truncate Tail and setNumberOfLines to 0 and its working for me. the label is of multiline now.