简体   繁体   English

我应该使用什么代替iOS5.1中不推荐使用的UISegmentedControlStyleBezeled?

[英]What should I use instead of the deprecated UISegmentedControlStyleBezeled in iOS5.1?

There are warnings when I build my app indicating my UISegmentedControlStyleBezeled is deprecated. 当我构建我的应用程序时,有警告,表明我的UISegmentedControlStyleBezeled已被弃用。 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. 没有其他类型的UISegmentedControl看起来接近Bezeled一个,所以我不知道我可以使用什么而不是它。 I need something like UISegmentedControlStyleBar but with more height. 我需要像UISegmentedControlStyleBar这样的东西,但身高更高。

Moreover, looking in UISegmentedControl.h reveals this... 而且,查看UISegmentedControl.h揭示了这个......

typedef enum {
    UISegmentedControlStylePlain,     // large plain
    UISegmentedControlStyleBordered,  // large bordered
    UISegmentedControlStyleBar,       // small button/nav bar style. tintable
    UISegmentedControlStyleBezeled,   // DEPRECATED. Do not use this style.
} UISegmentedControlStyle;

For the moment, the work around I use is using UISegmentedControlStyleBar and increase its frame height. 目前,我使用的工作是使用UISegmentedControlStyleBar并增加其帧高。 You might also want to keep the same center as well to avoid it expanding down. 您可能还希望保持相同的中心,以避免它向下扩展。

I have a feeling the reason they deprecated it was because they accidentally broke it in 5.1. 我觉得他们弃用它的原因是因为他们在5.1中意外地破坏了它。

I'm sure we will see it again in the future as people start moving off of 5.1. 我相信随着人们开始离开5.1,我们将来会再次看到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM