left aligned content for scenarios to where the container is stretched.

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-03-18 10:53:42 -05:00
parent 6290a43004
commit 2e0d0be8b6
2 changed files with 9 additions and 0 deletions

View File

@ -87,6 +87,10 @@ open class TextLink: ButtonBase {
isAccessibilityElement = true
accessibilityTraits = .link
//left align titleLabel in case this is pinned leading/trailing
//default is always set to center
contentHorizontalAlignment = .left
if let titleLabel {
addSubview(line)
line.pinLeading(titleLabel.leadingAnchor)

View File

@ -79,6 +79,11 @@ open class TextLinkCaret: ButtonBase {
/// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
open override func setup() {
super.setup()
//left align titleLabel in case this is pinned leading/trailing
//default is always set to center
contentHorizontalAlignment = .left
accessibilityTraits = .link
titleLabel?.numberOfLines = 0
titleLabel?.lineBreakMode = .byWordWrapping