Line height bug of NSAttributed string in UITextView

As mentioned by cocoanetics
http://www.cocoanetics.com/2012/12/radar-uitextview-ignores-minimummaximum-line-height-in-attributed-string/ (I can reproduce it on iPhone 5 with iOS 6.1.2)

Because there is a bug in UITextView, I had no way to adjust the line spacing of text. It should be ok for english, however chinese is not good enough. 

Image

So I had the following trick, 

When user switches to chinese, I set “Euphemia UCAS” as default font, but displays chinese text as normal in UITextView. I found that “line-spacing” will be inherited from “Euphemia UCAS”.

Image

 

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: