UITextView(FWPlaceholder)

@interface UITextView (FWPlaceholder)

多行输入框占位文本分类

  • 占位文本,默认nil

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSString *fw_placeholder;
  • 占位颜色,默认系统颜色

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIColor *fw_placeholderColor;
  • 带属性占位文本,默认nil

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSAttributedString *fw_attributedPlaceholder;
  • 自定义占位文本内间距,默认zero与内容一致

    Declaration

    Objective-C

    @property (nonatomic) UIEdgeInsets fw_placeholderInset;
  • 自定义垂直分布方式,会自动修改contentInset,默认Top与系统一致

    Declaration

    Objective-C

    @property (nonatomic) UIControlContentVerticalAlignment fw_verticalAlignment;
  • 是否启用自动高度功能,随文字改变高度

    Declaration

    Objective-C

    @property (nonatomic) BOOL fw_autoHeightEnabled;
  • 最大高度,默认CGFLOAT_MAX,启用自动高度后生效

    Declaration

    Objective-C

    @property (nonatomic) CGFloat fw_maxHeight;
  • 最小高度,默认0,启用自动高度后生效

    Declaration

    Objective-C

    @property (nonatomic) CGFloat fw_minHeight;
  • 高度改变回调句柄,默认nil,启用自动高度后生效

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) void (^)(CGFloat) fw_heightDidChange;
  • 快捷启用自动高度,并设置最大高度和回调句柄

    Declaration

    Objective-C

    - (void)fw_autoHeightWithMaxHeight:(CGFloat)maxHeight
                             didChange:(nullable void (^)(CGFloat))didChange;