Skip to content
This repository has been archived by the owner on Apr 11, 2021. It is now read-only.

Not Showing #51

Open
syedrazackimran opened this issue Aug 4, 2020 · 1 comment
Open

Not Showing #51

syedrazackimran opened this issue Aug 4, 2020 · 1 comment

Comments

@syedrazackimran
Copy link

Simulator Screen Shot - iPhone 11 Pro Max - 2020-08-04 at 11 15 35

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
@alfaro28
Copy link

Did you managed to get this problem solved? I'm having the same issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants