📜  带有左侧图标的 ui 标签 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:34.897000             🧑  作者: Mango

代码示例1
let labelLeft = SMIconLabel(frame: CGRect(x: 10, y: 10, width: view.frame.size.width - 20, height: 20))
labelLeft.text = "Icon on the left, text on the left"

// Here is the magic
labelLeft.icon = UIImage(named: "Bell")    // Set icon image
labelLeft.iconPadding = 5                  // Set padding between icon and label
labelLeft.numberOfLines = 0                // Required
labelLeft.iconPosition = (.left, .top)   // Icon position
view.addSubview(labelLeft)