UISegmentedControl in iOS 7 divider image is wrong during animation

前端 未结 6 853
清歌不尽
清歌不尽 2020-12-25 15:05

I have a custom UISegmentedControl. In iOS 6 and bellow it works fine. Under iOS 7.. it looks fine until I press the control, at which time, the divider image looks weird fo

6条回答
  •  温柔的废话
    2020-12-25 15:34

    I solved this by overriding touchesEnded in a subclass and disabling animations for CATransaction

    override func touchesEnded(touches: Set, withEvent event: UIEvent) {
        CATransaction.setDisableActions(true)
        super.touchesEnded(touches, withEvent: event)
    }
    

提交回复
热议问题