Adding underline to UILabel attributed string from the storyboard fails

Katedral Pillon picture Katedral Pillon · Aug 2, 2014 · Viewed 43.7k times · Source
  1. From the storyboard I select the UILabel in question
  2. Then in Attribute Inspector > Label > [I choose] Attributed
  3. Also in Attribute Inspector > Label > Text> [I select the content]
  4. Then I click on the font icon and choose underline

Basically, any change that I select from the Fonts window that pops up does not take effect.

Has anyone ever successfully add underline from the storyboard?

Note: I already know how to do this in code. I want to avoid adding code.

Answer

Abdullah Saeed picture Abdullah Saeed · May 14, 2015

Here is the solution in storyboard: Open the Attribute Inspector (make sure label is selected), Change the dropdown value from 'Plain' to 'Attributed'. Now a a small text editor will be visible under the font of the label. Select the text of the label, right click and change the font to 'underline'.

I also have attached a screenshot and successfully underlined a text using storyboard in XCode 7.0.1enter image description here