Is there anyway of making a UILabel wrap to the next line or do I have to use a UITextView?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- back button text does not change
相关文章
- 现在使用swift开发ios应用好还是swift?
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- 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
- How can I add media attachments to my push notific
- How do you detect key up / key down events from a
You would need to set the
numberOfLines
property to0
and explicitly specify its dimensions, either in IB or programmatically. However, if you have a lot of text to display, I would recommend using a UITextView.What you want is to adjust your label according to the content's size.
In iOS 6, AutoLayout will work a charm, you should set the label to have
numberOfLines = 0
In a non AutoLayout scenario, you will also want to make sure the frame of your
UILabel
is adjusted to show the content that's on the next line.Please check out this answer and sample code for that: https://stackoverflow.com/a/8796896/662605