我有UITableview
其中我根据UISwitch
状态显示UIImage
。我将开关状态存储在NSMutableArray
中。如果我尝试显示两个以上的图标,则只能显示两张图片。如果我关闭前两个UISwitch
状态中的任何一个状态。新的开关状态(我试图在之前显示)将显示,也只有一个。如何在uitableviewcell上显示UIImage
-2
A
回答
1
我假设在你的tableview中,每个单元格代表一个数组中的模型实例。这岂不是更好更新模型当开关处于?:
...
MyObject theObject= [myObjects objectAtIndex:index];
theObject.switchState = TRUE;
[self.tableView reloadData];
...
,然后重新加载的tableview细胞
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"cellidentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
MyObject *thisObject = [myObjects objectAtIndex:indexPath.row];
if(thisObject.switchState) {
... configure cell accordingly
}
return cell;
}
相关问题
- 1. 如何在CAShape层上显示UIImage?
- 2. UIImage在UITableViewCell
- 3. UIImage UITableViewCell
- 4. 如何让TTPhotoViewController显示UIImage?
- 5. 在UITableviewcell布局UIImage
- 6. 如何突出显示UITableViewCell
- 7. 在UITableViewCell上设置UIImage尺寸图像
- 8. UIImage&UITableViewCell尺寸
- 9. UITableViewCell上的图像显示
- 10. 的UIImage不会在屏幕上显示
- 11. 在UIWebview上显示本地UIImage
- 12. 如何在UITableViewCell中显示FBSDKLoginButton?
- 13. 如何在uitableviewcell中显示表格
- 14. 如何显示和URL,在UITableViewCell中
- 15. UIImage不显示
- 16. 如何在EAGLView(iPhone)上显示我的UIImage?
- 17. 如何在UIButton的UIImage上实现突出显示?
- 18. 如何随意在单个UIImage上显示多个图像
- 19. 数据不显示在UITableViewCell上Swift
- 20. 如何在单击的UITableViewCell上显示deleteConfirmationButton
- 21. UIImage不显示在UIAlertAction中?
- 22. UIImage不显示在UITableView
- 23. 如何使的UIImage显示为UIView的
- 24. UIImage没有显示
- 25. UIImage不会显示
- 26. UITableViewCell不显示UILabel在
- 27. 如何显示左删除按钮UITableViewCell
- 28. UITableViewCell accessoryView不显示
- 29. 显示UItableViewcell选择
- 30. 如何在uitableviewcell上显示编辑按钮,仅在您发布的帖子上显示
缩进你的代码yaar ... – 2013-05-01 08:30:34
现在怎么样anoop? – raptor 2013-05-01 08:58:58
我等了5分钟,然后我重新格式化了...现在这看起来不错:) – 2013-05-01 08:59:54