【发布时间】:2013-12-26 13:25:34
【问题描述】:
您好,我正在尝试为分组表视图部分的背景设置图像(不适用于部分标题),我正在使用以下代码:-
-(void)addBackgroundViewForSectionIndex:(int)tagIndex {
for (UIView * subview in tbl_home.subviews) {
if(subview.tag == tagIndex)
[subview removeFromSuperview];
}
CGRect sectionFrame = [tbl_home rectForSection:tagIndex];
UIImageView *newView = [[UIImageView alloc]initWithFrame:sectionFrame];
newView.tag = tagIndex;
[newView setImage:[UIImage imageNamed:@"Section@2x.png"]];
[tbl_home addSubview:newView];
[tbl_home sendSubviewToBack:newView];
}
将图像设置为背景,但存在某些单元格未显示或newView 超出某些单元格的问题。
我想像下面的截图一样设置图像:-
【问题讨论】:
-
nitin 给我一个示例代码,我会为你做的
标签: ios uitableview ios7