ios - 如何使 UILabel 或 UIButton 具有两行,第一行有一个字符,第二行有两个字符?

标签 ios swift uiview uibutton uilabel

我想要一个有两行的 UILabel 或 UIButton,第一行有一个字符,第二行有两个字符,如下图所示

enter image description here

有人知道吗?

最佳答案

对于多行 UIButton 只需将 Line Break 设置为 Word Wrap 并使用新行字符设置按钮文本(在界面生成器中是Ctrl+Enter)。

enter image description here

关于ios - 如何使 UILabel 或 UIButton 具有两行,第一行有一个字符,第二行有两个字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31051345/

相关文章:

ios - UIPopoverPresentationController 显示为全窗口弹出

swift - 在macOS的SwiftUI中更改文本编辑器背景颜色

ios - 具有粘性页脚 UIView 和动态高度内容的 UIScrollView

iphone - 将触摸传递给下一个响应者或其他 subview iOS

ios - 用文本填充单元格中的标签

objective-c - iOS : 2 Buttons both call the same view controller. 如何找到点击的是哪一个?

ios - UIcollectionview 的单元格项目隐藏或什至没有出列

ios - 在 Swift 中从 Firebase 检索数据

objective-c - 需要 SpriteKit 碰撞仅在第一次接触时发生

iphone - 如果不满足条件,则在 init 中销毁 UIView