应该使用什么代替iOS5.1中已弃用的UISegmentedControlStyleBezeled?

当我构建我的应用程序时,会出现警告,表明我的UISegmentedControlStyleBezeled已被弃用.没有其他类型的UISegmentedControl看起来靠近Bezeled,所以我不知道我可以用什么而不是它.我需要像UISegmentedControlStyleBar这样的东西,但具有更高的高度.

此外,在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;

解决方法

目前来说,我使用的工作是使用UISegmentedControlStyleBar并增加其帧高度.您也可能希望保持同一个中心,以避免扩张.

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...