【发布时间】:2014-03-20 06:14:18
【问题描述】:
我在 UITable Cell 上创建了 UIView,但它没有在 iOS7 中显示,这在 iOS6 中运行良好。请给我解决方案。
我们将在表格末尾添加更多按钮。
添加相同的代码:
UIView *footerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 768, 40)];
footerView.backgroundColor = [UIColor grayColor];
UIButton *btnLoadMore = [UIButton buttonWithType:UIButtonTypeCustom];
btnLoadMore.frame = CGRectMake(-10, 0, 768, 30);
btnLoadMore.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleWidth;
[btnLoadMore setTitle:@"Sample" forState:UIControlStateNormal];
[btnLoadMore setBackgroundColor:[UIColor redColor]];
[btnLoadMore setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[btnLoadMore addTarget:self action:@selector(loadMore) forControlEvents:UIControlEventTouchUpInside];
btnLoadMore.userInteractionEnabled=YES;
[btnLoadMore.titleLabel setFont:[UIFont fontWithName:@"Helvetica" size:17.0]];
[footerView addSubview:btnLoadMore];
[footerView setHidden:YES];
[footerView setTag:999];
[cell addSubview: footerView];
for (id subView in [cell subviews]) {
[subView setHidden:NO];
}
UIView *lastRow = [cell viewWithTag:999];
[lastRow setHidden:YES];
if(indexPath.section == [arSearch count] && isLoadMore){
for (id subView in [cell subviews]) {
[subView setHidden:YES];
}
cell.backgroundView = nil;
[lastRow setHidden:NO];
【问题讨论】:
标签: iphone objective-c uitableview ios7 uiview