1

Here is the example: My label display this text like this:=/*

enter image description here

What I want is let the = go upper, and the * go lower Here is something I want:

enter image description here

....How can I adjust it in UILabel?? Thanks.

DNB5brims
  • 29,344
  • 50
  • 131
  • 195
  • Do you need the `=` to be a superscript and the `*` to be a subscript? Have you tried NSAttributedString if that's the case? – dezinezync Mar 08 '14 at 06:15

1 Answers1

1

These other guys don't understand your question… but I do. :-)

There are two ways to do what you want.

  1. Find a font that centers every character vertically.
  2. Dive into Core Text, get the sizes of each character, and draw the string yourself with each character centered.

For #2, see this for some sample code.

Community
  • 1
  • 1
fumoboy007
  • 5,345
  • 4
  • 32
  • 49