如题,之前没注意过这个xib这个属性,可能很多小伙伴也没注意,下面为大家介绍一下xib这个逆天的操作。比起手动加attribute,简直简单粗暴。下面进入正题:
首先 你需要一个xib 在上边添加个label之类用于显示文本的控件

创建好之后,注意右边栏

选中第四栏,会发现label有个text的下拉框,点击下拉框

会发现,我们想要的attributed藏在这,之后我们选择attributed

我们之前的界面会变成如上的样子。其中

红框中的内容就是来给label的文字添加attributed的。接下来我们选中下边用于展示的title其中任意文字,然后再上边修改对应的字号,字体,颜色,会发现下边所选择的文字会根据你的选择而改变效果如下图:

使用不同字体展示,前提手机系统已经下载过了这些字体,否则就会没有效果。
转自网上
网友评论