问题
I have a UISegmentedControl that is being displayed within my UINavigationBar on an iPhone app running iOS 7. I've noticed that when I select one of the values in the UISegmentedControl the highlighting does not stay active. That is, if I select the first item, it triggers the action that I have added to it, but immediately un-highlights the value I selected.
Is this expected behavior? A bug? I don't recall ever seeing this in other apps using this control, and it works just fine on iOS 6. Thoughts?
回答1:
Make sure the momentary
property of the UISegmentedControl is NO (Apple docs).
来源:https://stackoverflow.com/questions/19793576/ios-7-uisegmentedcontrol-not-staying-highlighted