iOS 刷新tableView的某一行的row的时候,row的高度增加,数据也增加。

NSMutableArray *array=[NSMutableArray arrayWithObjects:@"444",@"555",@"666",@"777",@"888", nil];

if (array.count==0) {

UILabel *detailLabel=[QSSMyControl creatLabelWithFrame:CGRectMake(space1, label.frame.origin.y+label.frame.size.height+10, width, height) text:@"暂无记录" font:[UIFont systemFontOfSize:14] backgroundColor:[UIColor clearColor] textcolor:[UIColor blackColor]];

[cell.contentView addSubview:detailLabel];

}else {

if (array.count>3&&_ISchooseMore==NO) {

for (int i=0; i<3; i++) {

int x=i%3;

//int y=i/3;

UILabel *detailLabel=[QSSMyControl creatLabelWithFrame:CGRectMake(space1+width*x+space2*x, label.frame.origin.y+label.frame.size.height+10, width, height) text:[NSString stringWithFormat:@"***先生\n出价:%@",array[i]] font:[UIFont systemFontOfSize:14]
backgroundColor:[UIColor clearColor] textcolor:[UIColor blackColor]];

NSLog(@"x-----frame*************:%f",detailLabel.frame.origin.x);

NSLog(@"y-----frame*************:%f",detailLabel.frame.origin.y);

[cell.contentView addSubview:detailLabel];

}

}else{

for (int i=0; i<array.count; i++) {

int x=i%3;

int y=i/3;

UILabel *detailLabel=[QSSMyControl creatLabelWithFrame:CGRectMake(space1+width*x+space2*x, label.frame.origin.y+label.frame.size.height+10*y+height*y, width, height) text:[NSString stringWithFormat:@"***先生\n出价:%@",array[i]] font:[UIFont systemFontOfSize:14]
backgroundColor:[UIColor clearColor] textcolor:[UIColor blackColor]];

NSLog(@"x-----frame*************:%f",detailLabel.frame.origin.x);

NSLog(@"y-----frame*************:%f",detailLabel.frame.origin.y);

[cell.contentView addSubview:detailLabel];

}

}

}

//button的点击事件

-(void)chujiagengduobutton:(UIButton *)button{

if (_ISchooseMore==NO) {

_ISchooseMore=YES;

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

[self.myTableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];

}else {

_ISchooseMore=NO;

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

[self.myTableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];

}

}

时间: 2024-08-30 13:57:47

iOS 刷新tableView的某一行的row的时候,row的高度增加,数据也增加。的相关文章

iOS 刷新tableview方法

刷新UITableView 方法:[self.tableView reloadData]; reloadData是刷新整个UITableView,有时候,我们可能需要局部刷新.比如:只刷新一个cell.只刷新一个section等等.这个时候在调用reloadData方法,虽然用户看不出来,但是有些浪费资源. 刷新局部cell 方法:NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; [self.tableVi

李洪强iOS开发之 - 指定刷新tableview的某一组

李洪强iOS开发之 - 指定刷新tableview的某一组

IOS中TableView的用法

IOS中TableView的用法 一.UITableView 1.数据展示的条件 1> UITableView的所有数据都是由数据源(dataSource)提供的,所以要想在UITableView展示数据,必须设置UITableView的dataSource数据源对象 2> 要想当UITableView的dataSource对象,必须遵守UITableViewDataSource协议,实现相应的数据源方法 3> 当UITableView想要展示数据的时候,就会给数据源发送消息(调用数据源

IOS刷新数据

在一个项目开发过程中为了更好的体验经常会用到下拉刷新更新数据,当然也伴随一些上拉加载更多数据的情况:当前比较火的EGOTableViewPullRefresh只实现了下拉功能,而没有上拉的功能.这里介绍一个同时集成下拉刷新和上拉加载更多的类库EGOTableViewPullRefresh英文原文和类库下载地址:https://github.com/emreberge/EGOTableViewPullRefresh 附带 Demo效果 Whats different on this fork:容易

iOS 在TableView的Cell之间设置空白间隔空间

1.设置section的数目,即是你有多少个cell - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 3; // in your case, there are 3 cells } 2.对于每个section返回一个cell - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)secti

IOS 模仿TableView封装

一.先贴一下未封装的代号,好跟后面的对比 @interface MTHomeDropdown : UIView + (instancetype)dropdown; @property (nonatomic, strong) NSArray *categories; @end 1.categories只是其中一个类型的数据传入,无法多处使用 2.将他封装之后,可以供多个数据传入,多处使用 二.封装 @class MTHomeDropdown; @protocol MTHomeDropdownDat

[iOS] Create TableView &amp; customize UITableViewCell

1. First artical, notice the last thing - Connecting the DataSource and Delegate: http://www.appcoda.com/ios-programming-tutorial-create-a-simple-table-view-app/ 2. Second Artical: https://medium.com/@musawiralishah/creating-custom-uitableviewcell-us

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

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

iOS indexed tableview

http://stackoverflow.com/questions/18577462/how-to-make-a-tableview-divided-into-sections-by-letter-like-the-contacts-app http://www.iphonedevcentral.com/indexed-uitableview-tutorial/ http://furnacedigital.blogspot.com/2012/02/uitableview-sections.ht