Ortwin Gentz Ortwin Gentz - 1 year ago 106
iOS Question

Is it possible to adjust the baseline in NSAttributedString?

I'd like to slightly modify the y position of a character in an

. I know I can subscript (or superscript) using the attribute dictionary:

@{(id)kCTSuperscriptAttributeName: @(-1)}

Unfortunately the shift caused by this is too large in my case. I'm looking for an option to adjust the baseline in 1-point steps.

The attributed string will be displayed in a

Answer Source

As of iOS 7 the NSBaselineOffsetAttributeName attribute has been added.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download