iOS 刷新tableView的某一行的row的时候,row的高度增加,数据也增加。
来源:互联网 发布:交控集团网络商学院 编辑:程序博客网 时间:2024/04/30 05:12
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];
}
}
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];
}
}
1 0
- iOS 刷新tableView的某一行的row的时候,row的高度增加,数据也增加。
- TableView中row的数据更新
- div随着内容的增加高度也自适应增加
- ios 11以上系统,tableview上啦刷新,indexPath.row,自动加5,引起数组越界的问题导致崩溃
- UITableView刷新指定的row或者section
- 刷新tableView的某一分区或某一行
- 刷新页面数据自动增加的问题
- 随着文字内容增加,div的高度也跟着增加,并且文字自动换行
- 定制Row的不同颜色
- pipe row的用法
- oracle 在update row的时候是创建一个新row
- 数据库数据的增加
- DataGrid - 数据行的批量删除(Multi-Row deleting)
- git trace row history 找寻某一个文件中某一行的历史记录
- 500. Keyboard Row(判断单词能否由键盘上的某一行字符表示)
- iOS tableView的刷新 笔记
- 获取tableview的某一行
- bootstrap row 下面的 col-md 高度相等 高度 一致 高度一样 有大用
- Eclipse 下配置Ionic 开发Android
- Android 适配者模式
- Spring MVC源码分析(续)——请求处理(系列)
- msysGit管理GitHub代码
- Android Studio,迁移新版本的问题收集
- iOS 刷新tableView的某一行的row的时候,row的高度增加,数据也增加。
- 0.11之路(二):加载setup
- 第一节 常用组件 之 Aggregator 概述
- the file couldn't be opened because you don't have permission to view it
- redis3.0深入详解(1)
- 关于黑龙江省、哈尔滨市各类基金项目结题的通知
- hadoop安装过程遇到的问题
- Mac Openvpn配置
- 更新Xcode后解决插件失效的entire