开发者

UITableViewCell imageView.contentMode doesn't work in 3.0

开发者 https://www.devze.com 2022-12-22 11:50 出处:网络
In UITableViewCellStyleDefault, setting the contentMode on the imageView has no result.If I change my build SDK to version 3.1, everything again works.

In UITableViewCellStyleDefault, setting the contentMode on the imageView has no result. If I change my build SDK to version 3.1, everything again works.

I don't get any warn开发者_StackOverflow中文版ings or errors when compiling on 3.0 but this code:

cell.imageView.contentMode = UIViewContentModeScaleAspectFit;
cell.imageView.image = [UIImage imageNamed:[[NSString stringWithFormat:@"%@head.jpg",[gametype objectAtIndex:indexPath.row]]lowercaseString]];

seems to default to the UIViewContentModeCenter, so all of my pictures exceed the cell boundaries and encroach on neighboring cells.

Let me reiterate that if I change my target to 3.1 everything works correctly and all pictures are scaled accordingly to fit in the default imageView

Is this a known bug?


I'm getting the same effect on iOS 4 SDK when using UITableViewCellStyleDefault.

For additional info see iOS SDK UIViewContentModeScaleAspectFit vs. UIViewContentModeScaleAspectFill

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号