【发布时间】:2012-07-14 22:31:38
【问题描述】:
我有这段代码来创建我原来的 UIView:
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 存在吗?
标签: iphone objective-c ios uiview uiimageview