2012-09-28 53 views
0

我有一個UITableViewCell,我使用它的UIImageView和我有一個圖像的大小25,25,我設置UIImageView。問題是,當我點擊單元格時,圖像大小調整到行高,這不是我想要的。我希望它保持在25,25。這可能嗎?這裏是我的代碼:UIImageView在UITableViewCell調整行高

cell.imageView.bounds = CGRectMake(cell.imageView.origin.x, cell.imageView.origin.y, 25, 25); 
     cell.imageView.frame = cell.imageView.bounds; 
     cell.imageView.autoresizingMask = UIViewAutoresizingNone; 
     cell.imageView.clipsToBounds = YES; 
     cell.imageView.layer.borderWidth = 0; 
     cell.imageView.layer.borderColor = [UIColor blackColor].CGColor; 

回答

1

是的,它是可能的,但你必須由子類的UITableViewCell創建自己的UITableViewCell,並與你的固定大小

+0

如果我想使用內置的UIImageView什麼補充的UIImageView? – adit

+0

我不認爲有可能調整UIImageView集成到默認的tableViewCell,如果你想這樣做,你必須使用你的自定義UITableViewCell,http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing。 HTML可以幫助你 – Solidus