以下内容在使用Xcode 5和最新编译器的iOS 6上有效吗?
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];如果我没有弄错的话,UIButtonTypeSystem似乎和UIButtonTypeRoundedRect在iOS 6以及iOS 7上的决定是一样的,但我可能误解了这一点。
typedef NS_ENUM(NSInteger, UIButtonType) {
UIButtonTypeCustom = 0, // no button type
UIButtonTypeSystem NS_ENUM_AVAILABLE_IOS(7_0), // standard system button
UIButtonTypeDetailDisclosure,
UIButtonTypeInfoLight,
UIButtonTypeInfoDark,
UIButtonTypeContactAdd,
UIButtonTypeRoundedRect = UIButtonTypeSystem, // Deprecated, use UIButtonTypeSystem instead
};发布于 2014-05-05 18:59:14
如果您需要支持iOS 6,那么只需使用UIButtonTypeRoundedRect而不是UIButtonTypeSystem。然后,它将在iOS 6和7下工作。
发布于 2014-05-05 19:14:40
医生是你的朋友。在UIButtonTypeSystem下搜索,我们发现:
UIButtonTypeSystem系统样式按钮,如导航栏和工具栏中显示的按钮。可在iOS 7.0和更高版本的中使用。
所以不,UIButtonTypeSystem在iOS 7中是新的。旧的操作系统版本的结果将是未知的。
https://stackoverflow.com/questions/23479722
复制相似问题