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

Adding underline attribute to partial text UILabel in storyboard(为情节提要中的部分文本 UILabel 添加下划线属性)
本文介绍了为情节提要中的部分文本 UILabel 添加下划线属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

如何仅使用情节提要为 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.

它将下划线文本

这篇关于为情节提要中的部分文本 UILabel 添加下划线属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
Resume game cocos2d(恢复游戏 cocos2d)
Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
[ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)
UItextfield text alignment issue in cocos2D iPhone(cocos2D iPhone中的UItextfield文本对齐问题)