欢迎来到天天文库
浏览记录
ID:49608723
大小:96.01 KB
页数:2页
时间:2020-03-02
《iphone手机开发的uitableview自定义布局源代码.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、iPhone手机开发源代码iPhone手机开发UITableView自定义布局源代码我自己写的,复制粘贴后可以直接运行,查看效果,希望对iPhone手机开发感兴趣的有帮助[代码][C/C++/Objective-C]代码//获取单元格的代码-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath{staticNSString*CellIdentifier=@"CustomCellIdentifier";NSUIntegerrow=[index
2、Pathrow];//UITableViewCellStylestyle=UITableViewCellStyleDefault;//MyTableCeilMailBoxCeil*cell=(MailBoxCeil*)[tableViewdequeueReusableCellWithIdentifier:CellIdentifier];if(!cell){NSLog(@"myCellnotfound%@",cell);//MailBoxViewController*control=[[MailBoxViewControlleralloc]initWithNibName:@"Ma
3、ilBoxViewController"bundle:nil];NSArray*array=[[NSBundlemainBundle]loadNibNamed:@"MailCell"owner:[[MailBoxViewControlleralloc]init]options:nil];cell=(MailBoxCeil*)[arrayobjectAtIndex:1];//[cellsetSelectionStyle:UITableViewCellSelectionStyleGray];//cell=control.mailCell;NSLog(@"myCellnotfound
4、%@",cell);}if(row<5){NSLog(@"LineNumber%d",row);if(info[row].status){//NSLog(@"TRUEBOOL%d",info[row].status==1);cell.imageView.image=[UIImageimageNamed:@"MailReceive.png"];}else{//NSLog(@"FALSEBOOL%d",info[row].status==1);cell.imageView.image=[UIImageimageNamed:@"Mail"];}//cell.imageView.ima
5、ge=[UIImageimageNamed:@"Mail.png"];//cell.textLabel.text=info[row].title;cell.titleLabel.text=info[row].title;cell.contentLabel.text=info[row].content;iPhone手机开发源代码cell.senderLabel.text=info[row].content;}else{return[[UITableViewCellalloc]init];}//NSLog(@"Lable%s,source:%@",cell.textLabel.te
6、xt,info[row].title);returncell;}
此文档下载收益归作者所有