Ios UITableViewCell';s的辅助箭头未显示
我正在用xcode 6.1制作一个应用程序。我想将tableview样式更改为UITableViewCellAccessoryDisclosureIndicator,这是我通过编程和使用情节提要(storyboard)实现的,但不显示箭头。下面是我的代码。而且,当我通过序列图像板更改表视图样式时,它会显示在序列图像板中,但不会显示在模拟器上Ios UITableViewCell';s的辅助箭头未显示,ios,objective-c,uitableview,Ios,Objective C,Uitableview,我正在用xcode 6.1制作一个应用程序。我想将tableview样式更改为UITableViewCellAccessoryDisclosureIndicator,这是我通过编程和使用情节提要(storyboard)实现的,但不显示箭头。下面是我的代码。而且,当我通过序列图像板更改表视图样式时,它会显示在序列图像板中,但不会显示在模拟器上 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *tableviewidentifier = @"Cell";
UITableViewCell *cell= [self.My dequeueReusableCellWithIdentifier:tableviewidentifier];
//cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellAccessoryDisclosureIndicator reuseIdentifier:tableviewidentifier];
if(cell==nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:tableviewidentifier];
}
cell.textLabel.text = [[self.jsonresultarr objectAtIndex:indexPath.row] objectForKey:@"Brand_Name"];
cell.textLabel.textColor=[UIColor brownColor];
cell.textLabel.font=[UIFont fontWithName:@"Hoefler Text" size:17.0];
// here just like follow ur other details
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.imageView.image=[UIImage imageNamed:@"drugs.jpg"];
return cell;
}
尝试在您的故事板单元格选项中设置附件,“附件”:
尝试在您的故事板单元格选项中设置附件,“附件”:
我也遇到了同样的问题,问题是故事板中的Tableview没有固定在右侧(作为约束)。
因此,运行应用程序时,tableview比屏幕宽得多,因此箭头被隐藏。我通过正确设置约束来修复它。我也有同样的问题,问题是故事板中的Tableview没有固定在右侧(作为约束)。
因此,运行应用程序时,tableview比屏幕宽得多,因此箭头被隐藏。我通过正确设置约束来修复它。是否设置了所有自动布局约束?请尝试cell.accessoryView.backgroundColor=[UIColor grayColor];或cell.tintColor=[UIColor whiteColor];问题可能是由于您在故事板中设计的单元,或您在表视图中设置的属性或故事板中的单元。在CellForRowAtIndex路径中编写的代码没有问题。是否设置了所有自动布局约束?只需尝试cell.accessoryView.backgroundColor=[UIColor grayColor];或cell.tintColor=[UIColor whiteColor];问题可能是由于您在故事板中设计的单元,或您在表视图中设置的属性或故事板中的单元。在CellForRowAtIndex路径中编写的代码没有问题,该路径显示在情节提要上,但不显示在模拟器上删除此行:cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;在情节提要上显示相同,但在模拟器上不显示删除此行:cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;