refactored tabs
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
a1fd61992c
commit
b80be084ce
@ -131,11 +131,8 @@ extension Tabs {
|
|||||||
accessibilityTraits = .button
|
accessibilityTraits = .button
|
||||||
isAccessibilityElement = true
|
isAccessibilityElement = true
|
||||||
|
|
||||||
//activate the constraints
|
//pin layoutguide
|
||||||
NSLayoutConstraint.activate([layoutGuide.topAnchor.constraint(equalTo: topAnchor),
|
layoutGuide.pinToOwningView()
|
||||||
layoutGuide.bottomAnchor.constraint(equalTo: bottomAnchor),
|
|
||||||
layoutGuide.leadingAnchor.constraint(equalTo: leadingAnchor),
|
|
||||||
layoutGuide.trailingAnchor.constraint(equalTo: trailingAnchor)])
|
|
||||||
|
|
||||||
//pin trailing
|
//pin trailing
|
||||||
label.pinTrailing(layoutGuide.trailingAnchor)
|
label.pinTrailing(layoutGuide.trailingAnchor)
|
||||||
|
|||||||
@ -187,13 +187,13 @@ open class Tabs: View {
|
|||||||
|
|
||||||
contentView.heightAnchor.constraint(equalTo: scrollView.heightAnchor).isActive = true
|
contentView.heightAnchor.constraint(equalTo: scrollView.heightAnchor).isActive = true
|
||||||
|
|
||||||
borderlineViewWidthConstraint = borderlineView.widthAnchor.constraint(equalToConstant: 0)
|
borderlineViewWidthConstraint = borderlineView.width(constant: 0)
|
||||||
borderlineViewHeightConstraint = borderlineView.heightAnchor.constraint(equalToConstant: 0)
|
borderlineViewHeightConstraint = borderlineView.height(constant: 0)
|
||||||
|
|
||||||
borderlineViewLeadingConstraint = borderlineView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor)
|
borderlineViewLeadingConstraint = borderlineView.pinLeading(anchor: contentView.leadingAnchor)
|
||||||
borderlineViewTrailingConstraint = borderlineView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor)
|
borderlineViewTrailingConstraint = borderlineView.pinTrailing(anchor: contentView.trailingAnchor)
|
||||||
borderlineViewTopConstraint = borderlineView.topAnchor.constraint(equalTo: contentView.topAnchor)
|
borderlineViewTopConstraint = borderlineView.pinTop(anchor: contentView.topAnchor)
|
||||||
borderlineViewBottomConstraint = borderlineView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor)
|
borderlineViewBottomConstraint = borderlineView.pinBottom(anchor: contentView.bottomAnchor)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -132,12 +132,7 @@ open class TabsContainer: View {
|
|||||||
stackView.addArrangedSubview(tabMenu)
|
stackView.addArrangedSubview(tabMenu)
|
||||||
stackView.addArrangedSubview(contentView)
|
stackView.addArrangedSubview(contentView)
|
||||||
|
|
||||||
NSLayoutConstraint.activate([
|
tabMenuLayoutGuide.pinToOwningView()
|
||||||
tabMenuLayoutGuide.topAnchor.constraint(equalTo: topAnchor),
|
|
||||||
tabMenuLayoutGuide.bottomAnchor.constraint(equalTo: bottomAnchor),
|
|
||||||
tabMenuLayoutGuide.leadingAnchor.constraint(equalTo: leadingAnchor),
|
|
||||||
tabMenuLayoutGuide.trailingAnchor.constraint(equalTo: trailingAnchor)
|
|
||||||
])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Function used to make changes to the View based off a change events or from local properties.
|
/// Function used to make changes to the View based off a change events or from local properties.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user