This repository was archived by the owner on Apr 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
This repository was archived by the owner on Apr 11, 2021. It is now read-only.
Not Showing #51
Copy link
Copy link
Open
Description
it's not showing. refer screenshot and code. kindly do needfully.
@IBOutlet weak private var scrollSegmentControl: ScrollableSegmentedControl!
scrollSegmentControl.addTarget(self, action: #selector(self.changeSegement(with:)), for: .valueChanged)
let normalAttributes = [NSAttributedString.Key.font: Font(.installed(.OpenSansExtraBold), size: .custom(24)).instance,
.foregroundColor: UIColor.black]
let highLightedAttributes = [NSAttributedString.Key.font: Font(.installed(.OpenSansExtraBold), size: .custom(24)).instance,
.foregroundColor: UIColor.lightGray.withAlphaComponent(0.25)]
let selectedAttributes = [NSAttributedString.Key.font: Font(.installed(.OpenSansExtraBold), size: .custom(24)).instance,
.foregroundColor: UIColor.black]
scrollSegmentControl.setTitleTextAttributes(normalAttributes, for: .normal)
scrollSegmentControl.setTitleTextAttributes(highLightedAttributes, for: .highlighted)
scrollSegmentControl.setTitleTextAttributes(selectedAttributes, for: .selected)
scrollSegmentControl.selectedSegmentIndex = 0
scrollSegmentControl.insertSegment(withTitle: "Explore", at: 0)
scrollSegmentControl.insertSegment(withTitle: "Latest", at: 1)
scrollSegmentControl.insertSegment(withTitle: "Popular", at: 2)
scrollSegmentControl.insertSegment(withTitle: "Trending", at: 3)
scrollSegmentControl.insertSegment(withTitle: "Most Viewes", at: 4)
scrollSegmentControl.segmentStyle = .textOnly
scrollSegmentControl.segmentContentColor = .red
scrollSegmentControl.selectedSegmentContentColor = .yellow
scrollSegmentControl.backgroundColor = .clear
scrollSegmentControl.fixedSegmentWidth = false
scrollSegmentControl.underlineSelected = false
Metadata
Metadata
Assignees
Labels
No labels
