美文网首页
UITextfield 字符上下居中 2015-07-20

UITextfield 字符上下居中 2015-07-20

作者: blaze冰叔 | 来源:发表于2019-07-19 14:44 被阅读0次

UITextfield

textfield.textAlignment = NSTextAlignmentLeft;
textfield.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;

typedef NS_ENUM(NSInteger, UIControlContentVerticalAlignment) {
    UIControlContentVerticalAlignmentCenter  = 0,
    UIControlContentVerticalAlignmentTop     = 1,
    UIControlContentVerticalAlignmentBottom  = 2,
    UIControlContentVerticalAlignmentFill    = 3,
};
typedef NS_ENUM(NSInteger, UIControlContentHorizontalAlignment) {
    UIControlContentHorizontalAlignmentCenter = 0,
    UIControlContentHorizontalAlignmentLeft   = 1,
    UIControlContentHorizontalAlignmentRight  = 2,
    UIControlContentHorizontalAlignmentFill   = 3,
};

相关文章

网友评论

      本文标题:UITextfield 字符上下居中 2015-07-20

      本文链接:https://www.haomeiwen.com/subject/oetslctx.html