10

There are warnings when I build my app indicating my UISegmentedControlStyleBezeled is deprecated. There are no other types of UISegmentedControl that looks close to the Bezeled one so I don't know what I can use instead of it. I need something like UISegmentedControlStyleBar but with more height.

Moreover, looking in UISegmentedControl.h reveals this...

typedef enum {
    UISegmentedControlStylePlain,     // large plain
    UISegmentedControlStyleBordered,  // large bordered
    UISegmentedControlStyleBar,       // small button/nav bar style. tintable
    UISegmentedControlStyleBezeled,   // DEPRECATED. Do not use this style.
} UISegmentedControlStyle;
matt
  • 515,959
  • 87
  • 875
  • 1,141
Hlung
  • 13,850
  • 6
  • 71
  • 90
  • 1
    I saw the same thing. It's not deprecated in the docs which made me think it wasn't imminent. But with the recent UDID boondoggle, gotta wonder when the hammer is gonna come down. – smparkes Mar 28 '12 at 21:24

2 Answers2

5

For the moment, the work around I use is using UISegmentedControlStyleBar and increase its frame height. You might also want to keep the same center as well to avoid it expanding down.

Hlung
  • 13,850
  • 6
  • 71
  • 90
  • The problem with that workaround is that you ever call `sizeToFit` on the segmented control it returns to the smaller height. You might well need to do that if you're managing the segments dynamically. So this is not a very robust solution. – matt Jan 30 '13 at 17:25
4

I have a feeling the reason they deprecated it was because they accidentally broke it in 5.1.

I'm sure we will see it again in the future as people start moving off of 5.1.

endy
  • 3,872
  • 5
  • 29
  • 43
  • 1
    How do you see it broken? It's not broken for my use of it. Ah ... some folks are having tint trouble. So far, I haven't. Not looking forward to this ... – smparkes Mar 28 '12 at 21:23
  • Hmm, that's weird. I have tried that and it works fine. It correctly appears as StyleBezeled. Just when I try to get its barStyle property , I get StyleBar instead :/ – Hlung Mar 29 '12 at 04:40
  • In iOS 6 it appears to be absolutely broken. If you ask for UISegmentedControlStyleBezeled you won't get it. – matt Jan 30 '13 at 17:26