我想在横向模式下正确拉伸单元格背景。我'写下了这段代码:在cell.background视图中拉伸图像
UIImage* cellBackGroundImage = [UIImage imageNamed:@"button_listing_default.png"];
cellBackGroundImage = [cellBackGroundImage stretchableImageWithLeftCapWidth:290 topCapHeight:76];
deselectedBackground = [[UIImageView alloc] initWithImage:cellBackGroundImage] ;
[deselectedBackground setContentMode:UIViewContentModeScaleToFill];
cell.backgroundView = deselectedBackground;
图片大小为580x152。单元格大小为280x76。
但是,当我将设备变为横向时,我的图像的圆角缩放,但它们不应该。
肖像外观:Portrait appearance http://xmages.net/storage/10/1/0/6/6/upload/456703d5.png
景观外貌:Landscape appearance http://xmages.net/storage/10/1/0/d/0/upload/a99fb3a8.png
图像本身:The image itself http://xmages.net/storage/10/1/0/6/6/upload/e1895d8e.png
我曾尝试过cellBackGroundImage = [cellBackGroundImage stretchableImageWithLeftCapWidth:10 topCapHeight:10];但它没有帮助 – 2012-03-14 10:16:15
所以这些是你我的视网膜图像?所以在视网膜的边缘约为30px。所以你应该罚款15分的帽值。 (如果这些没有视网膜图像,则使用30分)。如果仍然无效,请向我们展示更多代码。并继续接受一些问题的答案! – calimarkus 2012-03-14 10:36:53
15和30没有帮助 – 2012-03-14 12:07:37