Adding underline attribute to partial text UILabel in storyboard
22,155
Solution 1
select the
UILabel
and go to Attribute Inspector section.
Change the text value from plain to Attributed .Select the particular part of text which you want to Underline .
Note: If u want full text to be Underline select full text.
Now right click and change the font to Underline.
It will Underline the text
Solution 2
Steps:-
- Go to TextEdit and create your UILabel text with underline.
- Change UILabel text to Attributed (Attributed Selector).
- Copy Underlined text and assign to UILabel.
Author by
C3332
Updated on February 01, 2020Comments
-
C3332 over 4 years
How can I underline partial text of
UILabel
using only storyboard? I am able to do this in code and I'm able to underline the entire text of a label, but not just one or two words in the string. -
David West about 8 yearsSo useful thanks - strange how Apple hid all that functionality away!
-
Kautham Krishna about 8 yearsThis answer works in iPhone 5s but does not show the underline in 6 and 6 plus devices. Is there any other way
-
iPhone 7 almost 8 yearssaved my life spent more than an hour searching on it
-
karique over 5 yearsi've been looking for this for a long time, thank you sir.
-
PhillipJacobs over 4 yearsSuch an easy solution! Thanks @RizwanShaikh 🔥👨🏽💻🕷
-
Tornike Gomareli almost 4 yearsI have searched the whole StackOverflow and this is the easiest and most simple solution I have found. Thank you very much. Being Senior developer is not about knowing every detail how to make from code, it is just hiding in simplicity.
-
Vinoth Anandan about 3 yearsQuestion is to apply, underline in the storyboard. For coding, we have answers in stackoverflow.com/questions/28053334/…