iOS:fix default gravity to be center

This commit is contained in:
pengfei.zhou 2020-05-06 15:11:01 +08:00 committed by osborn
parent 8db686b89b
commit 931c06393e

View File

@ -49,7 +49,6 @@ @interface DoricTextNode ()
@implementation DoricTextNode
- (UILabel *)build {
return [[[DoricTextView alloc] init] also:^(DoricTextView *it) {
it.textAlignment = NSTextAlignmentCenter;
[self ensureParagraphStyle];
}];
}
@ -163,7 +162,7 @@ - (void)blendView:(UILabel *)view forPropName:(NSString *)name propValue:(id)pro
- (NSMutableParagraphStyle *)ensureParagraphStyle {
if (self.paragraphStyle == nil) {
self.paragraphStyle = [NSMutableParagraphStyle new];
self.paragraphStyle.alignment = self.view.textAlignment;
self.paragraphStyle.alignment = NSTextAlignmentCenter;
self.paragraphStyle.lineBreakMode = NSLineBreakByTruncatingTail;
}
return self.paragraphStyle;