【发布时间】:2013-08-08 13:15:01
【问题描述】:
如何在 Table View 右上角设置 UIImage。我正在使用表格视图和显示联系人列表做 iPad 应用程序。单击联系人表格视图时要显示右侧详细信息...在这里我想放置一张在表格视图中选择的图像...
谁给我这个建议
谢谢
在这里查看我的代码
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
![enter image description here][1]
UIImageView *imv = [[UIImageView alloc]initWithFrame:CGRectMake(347, 0.5, 14, 48)];
imv.image=[UIImage imageNamed:@"activeBg.png"];
[cell.selectedBackgroundView addSubview:imv];
}
预期输出:
我的输出:
使用过的图片:
更改 x 值后看到此输出:
【问题讨论】:
-
更改
x中CGRectMake(347, 0.5, 14, 48)的值,可能是355 -
CGRectMake(352, 0.5, 14, 48) 我使用了这个代码
-
嘿@Swathi 检查我的答案,........
-
您的视图正在剪切它。
[view setClipsToBounds:NO];为您提供所有视图层次结构
标签: ios objective-c ipad ios5