ios - 设置自定义 UILabel

标签 ios fonts uilabel

我想获得一个与这张图片具有相同背景和字体的 UILabel

enter image description here

最佳答案

简单,首先拖放一个标签。

enter image description here

选择您的标签,然后您可以通过执行以下操作来调整其属性。

定义自定义字体颜色。

enter image description here

选择您认为最符合您要查找的字体。

enter image description here

更改背景颜色。

enter image description here

或者对于作为标签背景的渐变效果,您可以通过像这样将图像设置为背景来实现。

theLabel.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"blah"]];

我已经指导您完成了实现这一目标的步骤,但为了将来引用,您不会仅仅通过要求某人为您完成工作而在此网站上获得很好的响应。

关于ios - 设置自定义 UILabel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10156794/

相关文章:

iphone - 如果 UILabel 的内容不适合,请更改文本末尾的默认 '...'

swift - 在 UILabel Swift 顶部添加图像

android - 使用带有字体的特定字符时,文本会被截断

java - 如何更改 JPanel 的字体大小

css - @font-face 不适用于 Chrome、Firefox、IE

ios - 根据 Swift 中的文本大小调整 labelSize

ios - 在 UITableView 上激活 Speech to Text

ios - 仅通过 wifi 下载内容或同时使用 wifi 和 3G 网络下载

iOS:UITextView 设置高度等于内容高度

ios - Objective-C 中两个 View Controller 之间的双向通信