Evrim Demir
Evrim Demir

Reputation: 51

Swift 5 Segmented Control Truncates the Titles

I am using dynamic segmented control. Whenever user adds new decks, the title is showing up in the segmented control.

enter image description here

However, I need a horizontally scrollable segmented controller that might have different title width depending on the text (title) size.

Upvotes: 1

Views: 451

Answers (1)

Evrim Demir
Evrim Demir

Reputation: 51

this helped me to achieve it. iOS 13 Segmented Control: Remove swipe gesture to select segment

I added my segmented controller inside of scroll view. Then changed my segmented controller class to the following;

class NoSwipeSegmentedControl: UISegmentedControl {

    override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
        return true
    }
}

Upvotes: 1

Related Questions