AttributedLabel

open class AttributedLabel : UIView

M80AttributedLabel

Accessor

  • 事件代理

    Declaration

    Swift

    open weak var delegate: AttributedLabelDelegate?
  • 字体

    Declaration

    Swift

    open var font: UIFont? { get set }
  • 文字颜色

    Declaration

    Swift

    open var textColor: UIColor? { get set }
  • 链接点击时背景高亮色

    Declaration

    Swift

    open var highlightColor: UIColor? { get set }
  • 链接色

    Declaration

    Swift

    open var linkColor: UIColor? { get set }
  • 阴影颜色

    Declaration

    Swift

    open var shadowColor: UIColor? { get set }
  • 阴影offset

    Declaration

    Swift

    open var shadowOffset: CGSize { get set }
  • 阴影半径

    Declaration

    Swift

    open var shadowBlur: CGFloat { get set }
  • 链接是否带下划线

    Declaration

    Swift

    open var underLineForLink: Bool { get set }
  • 自动检测

    Declaration

    Swift

    open var autoDetectLinks: Bool { get set }
  • 自定义链接检测器,默认shared

    Declaration

    Swift

    open var linkDetector: AttributedLabelURLDetectorProtocol? { get set }
  • 链接点击句柄

    Declaration

    Swift

    open var clickedOnLink: ((Any) -> Void)?
  • 行数

    Declaration

    Swift

    open var numberOfLines: Int { get set }
  • 文字排版样式

    Declaration

    Swift

    open var textAlignment: CTTextAlignment { get set }
  • LineBreakMode

    Declaration

    Swift

    open var lineBreakMode: CTLineBreakMode { get set }
  • 行间距

    Declaration

    Swift

    open var lineSpacing: CGFloat { get set }
  • 段间距

    Declaration

    Swift

    open var paragraphSpacing: CGFloat { get set }
  • 普通文本,设置nil可重置

    Declaration

    Swift

    open var text: String? { get set }
  • 属性文本,设置nil可重置

    Declaration

    Swift

    open var attributedText: NSAttributedString? { get set }
  • 最后一行截断之后留白的宽度,默认0不生效,仅lineBreakMode为TruncatingTail且发生截断时生效

    Declaration

    Swift

    open var lineTruncatingSpacing: CGFloat { get set }
  • 最后一行截断之后显示的附件

    Declaration

    Swift

    open var lineTruncatingAttachment: AttributedLabelAttachment? { get set }

Lifecycle

  • Undocumented

    Declaration

    Swift

    public override init(frame: CGRect)
  • Undocumented

    Declaration

    Swift

    public required init?(coder: NSCoder)
  • Undocumented

    Declaration

    Swift

    open override var frame: CGRect { get set }
  • Undocumented

    Declaration

    Swift

    open override var bounds: CGRect { get set }
  • Undocumented

    Declaration

    Swift

    open override func sizeThatFits(_ size: CGSize) -> CGSize
  • Undocumented

    Declaration

    Swift

    open override var intrinsicContentSize: CGSize { get }
  • Undocumented

    Declaration

    Swift

    open override func draw(_ rect: CGRect)
  • Undocumented

    Declaration

    Swift

    open override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)
  • Undocumented

    Declaration

    Swift

    open override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?)
  • Undocumented

    Declaration

    Swift

    open override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?)
  • Undocumented

    Declaration

    Swift

    open override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?)
  • Undocumented

    Declaration

    Swift

    open override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView?

Public