原始AlertView按钮未显示

时间:2014-03-28 11:26:52

标签: iphone objective-c ios7

enter image description here

我使用普通UIAlertView。在ios 6中显示正常但在ios 7按钮标题中没有显示。

UIAlertView *theAlert = [[UIAlertView alloc] initWithTitle:@"Title"
                                                   message:@"This is the message."
                                                  delegate:self
                                         cancelButtonTitle:@"OK"
                                         otherButtonTitles:nil];
[theAlert show];

我有一个问题。我有TableViewCell

的类别
@implementation UITableViewCell(IOS7FIX)

- (void) layoutSubviews
{
    self.imageView.frame = CGRectMake( 1, 0, 60,50);
}

@end

这就是问题所在。

1 个答案:

答案 0 :(得分:1)

以下功能:

- (void) layoutSubviews

属于UIView,这个实现可能影响所有UIViews,因为它是一个通用的实现。所以我建议你更好地子类你的UITableViewCell并在子类中进行这样的检查,这是动态编译,并将为iOS7或更高版本运行此代码(或多个)。

- (void) layoutSubviews 
{
     // Do your stuff here

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
    self.imageView.frame = CGRectMake( 1, 0, 60,50);
#endif

     // Do your stuff here
}
相关问题