CGRect for selected UITextRange adjustment for multiline text?
问题 I've used this answer in order to create a CGRect for a certain range of text. In this UITextView I've set it's attributedText (so I've got a bunch of styled text with varying glyph sizes). This works great for the first line of text that's left aligned, but it has some really strange results when working with NSTextAlignmentJustified or NSTextAlignmentCenter . It also doesn't calculate properly when the lines wrap around or (sometimes) if there are \n line breaks. I get stuff like this (this