ScrollableSegmentedControl icon indicating copy to clipboard operation
ScrollableSegmentedControl copied to clipboard

Not Showing

Open syedrazackimran opened this issue 5 years ago • 1 comments

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

syedrazackimran avatar Aug 04 '20 05:08 syedrazackimran

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

alfaro28 avatar Jan 14 '21 17:01 alfaro28