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

2019-07-19  本文已影响0人  blaze冰叔

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,
};
上一篇 下一篇

猜你喜欢

热点阅读