0
我有這樣的代碼來創建我原來的UIView:的UIImageView不是取代另一種觀點認爲
itemView = [[UIView alloc] initWithFrame:CGRectMake(self.frame.size.width - CELL_HEIGHT - 10, 0, CELL_HEIGHT, CELL_HEIGHT)];
itemView.backgroundColor = [UIColor redColor];
[self addSubview:itemView];
然後,我有這樣的代碼後面:
UIImageView *accessory = [[UIImageView alloc] initWithFrame:cell.itemView.frame];
accessory.contentMode = UIViewContentModeCenter;
accessory.image = [UIImage imageNamed:@"icon_settings_fwd.png"];
itemView = accessory;
但所有我看到的是紅色的。它沒有用UIImage取代它。任何人都知道爲什麼?
你確定這個icon_settings_fwd.png存在嗎? – Raj 2013-01-22 08:45:26