我想在橫向模式下正確拉伸單元格背景。我'寫下了這段代碼:在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