简体   繁体   中英

UILabel - Wrap text so that it is weighted to the bottom left

I'm looking for a way to wrap the text of a UILabel (or using another library such as FXLabel ) so that it is weighted to the bottom left. The labels contain no more than five words.


Examples

The
Brown Fox


2017
Top Five
World Events


The sun
is shining today.



As you can tell, the wrapping is weighed to the bottom left of the label/text box. Any knowledge/ideas of how to do this in Xcode / Objective-C ?

- Edit -

I am looking for a way to position the line breaks between the words - rather than position the whole label. I do not know enough about fonts/texts to give to correct definition/wording of what I mean - I am sorry.

The common way to solve this issue is to use a simple auto-sizing UILabel , then fix the UILabel to the bottom left of it's superview using Auto-layout.

Note: Auto-sizing UILabels are no more than simple UILabels without any width & height constraint set.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM