开发者

Selecting and Deselecting segment on UISegmentedControl?

开发者 https://www.devze.com 2023-03-07 16:00 出处:网络
I\'ve added a segmented control as the right bar button item of my navigation bar. The control has two segments and I\'m attempting to use the control as bar button items. So I was wondering haw can I

I've added a segmented control as the right bar button item of my navigation bar. The control has two segments and I'm attempting to use the control as bar button items. So I was wondering haw can I deselect a selected segment once the user preses it. I've already tried setting the selectedSegmentIndex property to -1 when the action method is called but that is preventing the segment from even being highlighted. Any idea on how can can get the segments to behav开发者_StackOverflow社区e like bar button item?


do segmentedControl.momentary = YES; during setup or if using IB, select the Momentary checkbox in the Attributes Inspector.

0

精彩评论

暂无评论...
验证码 换一张
取 消