資源描述:
《iphone手機開發(fā)的uitableview自定義布局源代碼.doc》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。
1、iPhone手機開發(fā)源代碼iPhone手機開發(fā)UITableView自定義布局源代碼我自己寫的,復(fù)制粘貼后可以直接運行,查看效果,希望對iPhone手機開發(fā)感興趣的有幫助[代碼][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手機開發(fā)源代碼cell.senderLabel.text=info[row].content;}else{return[[UITableViewCellalloc]init];}//NSLog(@"Lable%s,source:%@",cell.textLabel.te
6、xt,info[row].title);returncell;}