【发布时间】:2013-09-07 05:32:31
【问题描述】:
如果设备是iOS 6.0 + 版本,我试图在UITableView 单元格中隐藏UIImageView。如果设备使用iOS 6.0 或更低版本,我想显示UIImageView?
下面的代码对我不起作用。我可以在两个版本中看到 UIImage。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
//NSLog(@"%@",recentBookName);
static NSString *CellIdentifier = @"Cell";
GMMListViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell.NameLabel.text=[BookName objectAtIndex:indexPath.row];
cell.authorLabel.text=[AuthorName objectAtIndex:indexPath.row];
if([[[UIDevice currentDevice]systemVersion] floatValue]<6.0){
cell.rupeeSymbol.hidden=NO;
}else{
cell.rupeeSymbol.hidden=YES;
}
return cell;
}
【问题讨论】:
-
您是否尝试调试并确保 rupeeSymbol 具有价值?有时我们确实忘记将插座与笔尖连接起来。
-
你在哪个版本测试它?
-
试试
if([[[UIDevice currentDevice]systemVersion] floatValue]<6.0f){ } -
感谢您的 cmets 现在正在工作
标签: ios objective-c uitableview uiimageview