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

Not Showing  #51

@syedrazackimran

Description

@syedrazackimran

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions