Why are my UISegmentControl segments highlighting in iOS 8 when I have set background images for all states?

前端 未结 2 1475
一生所求
一生所求 2021-01-02 07:47

In iOS 6/7, I have used UISegmentedControl with background images to create an effect like so:

\"Cu

2条回答
  •  难免孤独
    2021-01-02 08:10

    Just in case, in Swift that would be (UPD for Swift 4)

    segmentedControl.setBackgroundImage(image, forState: .selected, barMetrics:.Default)

    segmentedControl.setBackgroundImage(image, forState: .highlighted, barMetrics:.Default)

提交回复
热议问题