iOS 7 - UISegmentedControl not staying highlighted?

眉间皱痕 提交于 2020-01-15 05:20:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!