fixed bug in text position
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
921e13b3cf
commit
883281a94a
@ -207,9 +207,16 @@ open class LabelBase<ModelType: LabelModel>: UILabel, ModelHandlerable, ViewProt
|
|||||||
let paragraph = NSMutableParagraphStyle().with {
|
let paragraph = NSMutableParagraphStyle().with {
|
||||||
$0.maximumLineHeight = lineHeight
|
$0.maximumLineHeight = lineHeight
|
||||||
$0.minimumLineHeight = lineHeight
|
$0.minimumLineHeight = lineHeight
|
||||||
|
$0.alignment = viewModel.textPosition.textAlignment
|
||||||
}
|
}
|
||||||
attributedString.addAttribute(.baselineOffset, value: baselineOffset, range: entireRange)
|
attributedString.addAttribute(.baselineOffset, value: baselineOffset, range: entireRange)
|
||||||
attributedString.addAttribute( .paragraphStyle, value: paragraph, range: entireRange)
|
attributedString.addAttribute( .paragraphStyle, value: paragraph, range: entireRange)
|
||||||
|
|
||||||
|
} else if viewModel.textPosition != .left {
|
||||||
|
let paragraph = NSMutableParagraphStyle().with {
|
||||||
|
$0.alignment = viewModel.textPosition.textAlignment
|
||||||
|
}
|
||||||
|
attributedString.addAttribute( .paragraphStyle, value: paragraph, range: entireRange)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user