From ef0d97fd8f2f70e1c429d7f5a42540c2610d41ac Mon Sep 17 00:00:00 2001 From: Harrie Shin Date: Tue, 29 Nov 2022 21:09:09 -0800 Subject: [PATCH] fix rotation bug on segmented control --- ios/FluentUI/SegmentedControl/SegmentedControl.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ios/FluentUI/SegmentedControl/SegmentedControl.swift b/ios/FluentUI/SegmentedControl/SegmentedControl.swift index 31244bacd6..cbcecfbbd8 100644 --- a/ios/FluentUI/SegmentedControl/SegmentedControl.swift +++ b/ios/FluentUI/SegmentedControl/SegmentedControl.swift @@ -419,6 +419,7 @@ open class SegmentedControl: UIControl { } button.frame = CGRect(x: leftOffset, y: 0, width: rightOffset - leftOffset, height: pillContainerView.frame.height) leftOffset = rightOffset + button.setNeedsLayout() } // flipSubviewsForRTL only works on direct children subviews @@ -437,7 +438,7 @@ open class SegmentedControl: UIControl { if shouldSetEqualWidthForSegments { invalidateIntrinsicContentSize() } - layoutSubviews() + setNeedsLayout() } open override func sizeThatFits(_ size: CGSize) -> CGSize { @@ -485,10 +486,6 @@ open class SegmentedControl: UIControl { updateWindowSpecificColors() } - func intrinsicContentSizeInvalidatedForChildView() { - invalidateIntrinsicContentSize() - } - /// Used to retrieve the view from the segment at the specified index open func segmentView(at index: Int) -> UIView? { guard index <= buttons.count else {