Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple selection with UISegmentedControl - what is Pages using?

I want to make a Bold/Underline/Italic toolbar like you see on Pages (iPhone/iPad). They use what appears to be a UISegmentedControl.

But they can have both Bold/Underline selected at the same time, which doesn't seem to be possible with the current UISegmentedControl. The closest thing I can find is "momentary", which makes the UISegmentedControl like a button array.

The NSSegmentedControl (Mac version) seems to have this ability by setting [cell setTrackingMode:NSSegmentSwitchTrackingSelectAny]. It also has NSSegmentSwitchTrackingMomentary, similar to UISegmentedControl (which uses a BOOL).

Is there a way to sub-class the UISegmentedControl to add this ability? Is there any good third party toolbars controls that do this? What Apple's Pages doing?

like image 497
Luke Avatar asked Jul 31 '12 15:07

Luke


1 Answers

I don't think you can do it with UISegmentedControl. You may want to create them as separate UIButtons and do whatever you wish to them. After all, you are using behavior like UIButtons, so it shouldn't be any harder.

like image 105
danqing Avatar answered Sep 27 '22 23:09

danqing