用户登录
用户注册

分享至

为情节提要中的部分文本 UILabel 添加下划线属性

  • 作者: Kop杰拉德
  • 来源: 51数据库
  • 2022-12-30

问题描述

如何仅使用情节提要为 UILabel 的部分文本添加下划线?我可以在代码中执行此操作,并且可以在标签的整个文本下划线,但不仅仅是字符串中的一两个单词.

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.

推荐答案

  1. 选择 UILabel 并转到 Attribute Inspector 部分.
    将文本值从 plain 更改为 Attributed .

  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.

它将下划线文本

软件
前端设计
程序设计
Java相关