iOS开发——tableview的小常识

//一个section刷新

NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2];

[tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];

//一个cell刷新

NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];

[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];

时间: 2024-08-05 17:48:26

iOS开发——tableview的小常识的相关文章

知识点回顾-27个iOS开发中的小技巧

★27个iOS开发中的小技巧 1.不想让TableView显示无用的Cell分割线怎么办? self.tableView.tableFooterView = [[UIView alloc] init]; 2.自定义了leftBarbuttonItem左滑返回手势失效了怎么办? self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:img style:UIBarButtonItemStylePl

iOS开发tableView去掉顶部上部空表区域

tableview中的第一个cell 里上部 有空白区域,大概64像素 在viewDidLoad中加入如下代码 self.automaticallyAdjustsScrollViewInsets = NO; 原文地址:iOS开发tableView去掉顶部上部空表区域

iOS开发的一些小技巧

20140326 1.判断设备是3.5寸还是4寸? if ([[UIScreen mainScreen] currentMode].size.height == 480||[[UIScreenmainScreen] currentMode].size.height == 960) { //这是3.5寸的iPhone设备 } else { //这是4寸的iPhone设备 } 之前写了好长时间代码,忘了在3.5寸屏幕适配,今天一跑,发现控件的显示有问题,需要通过代码判断下屏幕尺寸,然后做相应处理,但

在这里总结一些iOS开发中的小技巧,能大大方便我们的开发,持续更新。

UITableView的Group样式下顶部空白处理 //分组列表头部空白处理 UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 0.1)]; self.tableView.tableHeaderView = view; UITableView的plain样式下,取消区头停滞效果 - (void)scrollViewDidScroll:(UIScrollView *)scrollView { CGFloat sect

一些IOS开发中的小技巧

1.打包后提交爆错误 错误信息:ERROR ITMS-90035: "Invalid Signature. Code object is not signed at all. The binary at path [******.app/build-libidn.sh] 解决方案:在Archive 界面上 选择刚生成的那个app 右键 Show in Finder  显示包含内容->Products->Application->应用 右键显示包含内容,找到文件 build-li

iOS开发 - Quartz2D绘制小黄人

Quartz2D绘制小黄人 - (void)drawRect:(CGRect)rect { // 1.上下文 CGContextRef ctx = UIGraphicsGetCurrentContext(); // 2.身体 drawBody(ctx, rect); // 3.嘴(微笑) drawMouth(ctx, rect); // 4.画眼睛 drawEyes(ctx, rect); } /** * 眼睛 */ void drawEyes(CGContextRef ctx, CGRect

iOS开发- TableView不显示没内容的Cell

有时候使用UITableView, 会遇到这样的情况: 底部没内容的cell也显示了.这样分割线很影响显示效果. 简单的加入如下语句: self.tableView.tableFooterView = [[UIView alloc] init]; 加上之后. 效果如下:

iOS开发tableview二级联动的细节实现中注意的细节总结

首先说网络慢带来的数据显示问题 可以通过判断请求参数是否一致来刷新tableview. SJBCategaryModel * categaryModel = self.categarys[CategarySelectRow]; NSMutableDictionary * params = [NSMutableDictionary dictionary]; categaryModel.currentPage = 1; params[@"a"] = @"list"; p

[IOS 开发] TableView、多个TableViewCell、自定义Cell、Cell上画画(故事板+代码方式)

第一步: //UserTableViewCell.h这里定义第一种Cell #import <UIKit/UIKit.h> @interface UserTableViewCell : UITableViewCell @property (weak, nonatomic) IBOutlet UIImageView *userviewcellicon; @property (weak, nonatomic) IBOutlet UILabel *userviewcellname; @end //U