如何将图像比uitableviewcell本身放大为子视图或背景视图。如何在大于单元格和桌面视图的UItableviewcell上添加图像
我需要显示单元格被选中时的背景图片。
编辑: 文件附看到突出显示的行:箭头比的tableview本身更大,它比小区更大
如何将图像比uitableviewcell本身放大为子视图或背景视图。如何在大于单元格和桌面视图的UItableviewcell上添加图像
我需要显示单元格被选中时的背景图片。
编辑: 文件附看到突出显示的行:箭头比的tableview本身更大,它比小区更大
在的tableView数据源的方法
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
你可以这样做:
UIImageView * imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image_background.png"]];
cell.selectedBackgroundView = imageView;
当选中单元格时,其背景设置为imageView
。
如果你不使用任何背景图片为您UITableViewCell
比使用delegate method of
的UITableView:如果您使用的背景图片为您UITableViewCell
比cellForRowAtIndexPath:
UIImageView *selBGView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"urimage.png"]];
cell.selectedBackgroundView = selBGView;
请参阅我的编辑以上.. .. ge附上 – Jatin
使用'
我知道如何做到以上.....但我想图像重叠整个单元格,并且其宽度比整个单元格更大 – Jatin
请参阅上面的编辑..附图 – Jatin