xCode4 尝试将自定义图标添加到 tableView 单元格
我将自定义图标添加到 tableView 时得到的结果好坏参半。我当然可以使用一些帮助来解释为什么......
我的代码如下:
if (cell.textLabel.text == @"People") {
cell.imageView.image = [UIImage imageNamed:@"People.png"];
}
if (cell.textLabel.text == @"Summary") {
cell.imageView.image = [UIImage imageNamed:@"Summary.png"];
}
if (cell.textLabel.text == @"Date") {
cell.imageView.image = [UIImage imageNamed:@"Date.png"];
People.png 工作正常。 Summary.png 向右偏移,Date.png 不显示。
请参阅附图..
I am having mixed results adding custom icons to a tableView. I sure could use some help as to why..
My code is as follows:
if (cell.textLabel.text == @"People") {
cell.imageView.image = [UIImage imageNamed:@"People.png"];
}
if (cell.textLabel.text == @"Summary") {
cell.imageView.image = [UIImage imageNamed:@"Summary.png"];
}
if (cell.textLabel.text == @"Date") {
cell.imageView.image = [UIImage imageNamed:@"Date.png"];
People.png works ok. Summary.png is offset to the right, and Date.png doesn't show.
Please see the attached image..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在将 NSString 与 == 进行比较!?
You're comparing NSStrings with == !?