QMUIGhostButton

@interface QMUIGhostButton : QMUIButton

“幽灵”按钮,也即背景透明、带圆角边框的按钮

可通过 QMUIGhostButtonColor 设置几种预设的颜色,也可以用 ghostColor 设置自定义颜色。

Warning

默认情况下,ghostColor 只会修改文字和边框的颜色,如果需要让 image 也跟随 ghostColor 的颜色,则可将 adjustsImageWithGhostColor 设为 YES
  • Undocumented

    Declaration

    Objective-C

    @property(nonatomic, strong, nullable) IBInspectable UIColor *ghostColor

    Swift

    var ghostColor: UIColor? { get set }
  • Undocumented

    Declaration

    Objective-C

    @property(nonatomic, assign) CGFloat borderWidth

    Swift

    var borderWidth: CGFloat { get set }
  • Undocumented

    Declaration

    Objective-C

    @property(nonatomic, assign) CGFloat cornerRadius

    Swift

    var cornerRadius: CGFloat { get set }
  • 控制按钮里面的图片是否也要跟随 ghostColor 一起变化,默认为 NO

    Declaration

    Objective-C

    @property (nonatomic) BOOL adjustsImageWithGhostColor;

    Swift

    var adjustsImageWithGhostColor: Bool { get set }
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithGhostType:(QMUIGhostButtonColor)ghostType;

    Swift

    init(ghostType: QMUIGhostButtonColor)
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithGhostColor:(nullable UIColor *)ghostColor;

    Swift

    init(ghostColor: UIColor?)