QMUIDialogTextFieldViewController

@interface QMUIDialogTextFieldViewController : QMUIDialogViewController

支持单行文本输入的弹窗,可通过textField.maximumLength来控制最长可输入的字符,超过则无法继续输入。 可通过enablesSubmitButtonAutomatically来自动设置submitButton.enabled的状态

  • Undocumented

    Declaration

    Objective-C

    @property(nullable, nonatomic, strong) UIFont *textFieldLabelFont

    Swift

    var textFieldLabelFont: UIFont? { get set }
  • Undocumented

    Declaration

    Objective-C

    @property(nullable, nonatomic, strong) UIColor *textFieldLabelTextColor

    Swift

    var textFieldLabelTextColor: UIColor? { get set }
  • Undocumented

    Declaration

    Objective-C

    @property(nullable, nonatomic, strong) UIFont *textFieldFont

    Swift

    var textFieldFont: UIFont? { get set }
  • Undocumented

    Declaration

    Objective-C

    @property(nullable, nonatomic, strong) UIColor *textFieldTextColor

    Swift

    var textFieldTextColor: UIColor? { get set }
  • Undocumented

    Declaration

    Objective-C

    @property(nullable, nonatomic, strong) UIColor *textFieldSeparatorColor

    Swift

    var textFieldSeparatorColor: UIColor? { get set }
  • 输入框上方文字的间距,如果不存在文字则不使用这个间距

    Declaration

    Objective-C

    @property (nonatomic) UIEdgeInsets textFieldLabelMargins;

    Swift

    var textFieldLabelMargins: UIEdgeInsets { get set }
  • 输入框本身的间距,注意输入框内部自带 textInsets,所以可能文字实际的显示位置会比这个间距更往内部一点

    Declaration

    Objective-C

    @property (nonatomic) UIEdgeInsets textFieldMargins;

    Swift

    var textFieldMargins: UIEdgeInsets { get set }
  • 输入框的高度

    Declaration

    Objective-C

    @property (nonatomic) CGFloat textFieldHeight;

    Swift

    var textFieldHeight: CGFloat { get set }
  • 输入框底部分隔线基于默认布局的偏移,注意分隔线默认的布局为:宽度是输入框宽度减去输入框左右的 textInsets,y 紧贴输入框底部。如果 textFieldSeparatorLayer.hidden = YES 则布局时不考虑这个间距

    Declaration

    Objective-C

    @property (nonatomic) UIEdgeInsets textFieldSeparatorInsets;

    Swift

    var textFieldSeparatorInsets: UIEdgeInsets { get set }
  • Undocumented

    Declaration

    Objective-C

    - (void)addTextFieldWithTitle:(nullable NSString *)textFieldTitle configurationHandler:(void (^ _Nullable)(QMUILabel *titleLabel, QMUITextField *textField, CALayer *separatorLayer))configurationHandler;

    Swift

    func addTextField(withTitle textFieldTitle: String?, configurationHandler: ((QMUILabel, QMUITextField, CALayer) -> Void)? = nil)
  • Undocumented

    Declaration

    Objective-C

    @property(nullable, nonatomic, copy, readonly) NSArray<QMUILabel *> *textFieldTitleLabels

    Swift

    var textFieldTitleLabels: [QMUILabel]? { get }
  • Undocumented

    Declaration

    Objective-C

    @property(nullable, nonatomic, copy, readonly) NSArray<QMUITextField *> *textFields

    Swift

    var textFields: [QMUITextField]? { get }
  • Undocumented

    Declaration

    Objective-C

    @property(nullable, nonatomic, copy, readonly) NSArray<CALayer *> *textFieldSeparatorLayers

    Swift

    var textFieldSeparatorLayers: [CALayer]? { get }
  • 是否应该自动管理输入框的键盘 Return 事件,默认为 YES,YES 表示当点击 Return 按钮时,视为点击了 dialog 的 submit 按钮。你也可以通过 UITextFieldDelegate 自己管理,此时请将此属性置为 NO。

    Declaration

    Objective-C

    @property (nonatomic) BOOL shouldManageTextFieldsReturnEventAutomatically;

    Swift

    var shouldManageTextFieldsReturnEventAutomatically: Bool { get set }
  • 是否自动控制提交按钮的enabled状态,默认为YES,则当任一输入框内容为空时禁用提交按钮

    Declaration

    Objective-C

    @property (nonatomic) BOOL enablesSubmitButtonAutomatically;

    Swift

    var enablesSubmitButtonAutomatically: Bool { get set }
  • Undocumented

    Declaration

    Objective-C

    @property(nullable, nonatomic, copy) BOOL (^shouldEnableSubmitButtonBlock

    Swift

    var shouldEnableSubmitButtonBlock: ((QMUIDialogTextFieldViewController) -> Bool)? { get set }