iOS:fix text cannot apply padding properly
This commit is contained in:
parent
c1f4805444
commit
6cf0f4603e
@ -25,9 +25,19 @@
|
||||
#import "DoricGroupNode.h"
|
||||
#import "Doric.h"
|
||||
|
||||
@interface DoricTextView : UILabel
|
||||
|
||||
@end
|
||||
|
||||
@implementation DoricTextView
|
||||
- (void)drawTextInRect:(CGRect)rect {
|
||||
[super drawTextInRect:UIEdgeInsetsInsetRect(rect, self.padding)];
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation DoricTextNode
|
||||
- (UILabel *)build {
|
||||
return [[[UILabel alloc] init] also:^(UILabel *it) {
|
||||
return [[[DoricTextView alloc] init] also:^(UILabel *it) {
|
||||
it.textAlignment = NSTextAlignmentCenter;
|
||||
}];
|
||||
}
|
||||
|
Reference in New Issue
Block a user