在xcode 6 和 ios 8 中,如果使用了 use size classes 的方法来调整屏幕尺寸。
在自动调整table view 和 table cell view的时候,会出现 cell的宽度不会自动适应各种手机屏幕尺寸的问题。
解决办法:
在自定义的 table cell 类中 重写
- (void)setFrame:(CGRect)frame
根据当前的设备的宽度来自动设置 cell的宽度
- (void)setFrame:(CGRect)frame {
frame.size.width = self.window.frame.size.width;
[super setFrame:frame];
}