Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix rotation bug on segmented control #1411

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions ios/FluentUI/SegmentedControl/SegmentedControl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -437,7 +438,7 @@ open class SegmentedControl: UIControl {
if shouldSetEqualWidthForSegments {
invalidateIntrinsicContentSize()
}
layoutSubviews()
setNeedsLayout()
}

open override func sizeThatFits(_ size: CGSize) -> CGSize {
Expand Down Expand Up @@ -485,10 +486,6 @@ open class SegmentedControl: UIControl {
updateWindowSpecificColors()
}

func intrinsicContentSizeInvalidatedForChildView() {
invalidateIntrinsicContentSize()
}

/// Used to retrieve the view from the segment at the specified index
harrieshin marked this conversation as resolved.
Show resolved Hide resolved
open func segmentView(at index: Int) -> UIView? {
guard index <= buttons.count else {
Expand Down