大佬教程收集整理的这篇文章主要介绍了ios7 – SWTableViewCell一次显示一个菜单,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我的单元格代码
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowATindexPath:(NSIndexPath *)indexPath{ NSMutableArray *leftUtilityButtons = [NSMutableArray new]; [leftUtilityButtons sw_addUtilityButtonWithColor: [UIColor colorWithRed:0.07 green:0.75f blue:0.16f alpha:1.0] icon:[UIImage imag@R_696_8371@d:@"about-icon-md.png"]]; [leftUtilityButtons sw_addUtilityButtonWithColor: [UIColor colorWithRed:0.07 green:0.75f blue:0.16f alpha:1.0] icon:[UIImage imag@R_696_8371@d:@"chat-4-64.png"] ]; static NSString* identifier=@"addContactCell"; Cell *cell=(Cell *)[tableView dequeueReusableCellWithIdentifier:identifier]; Cell __weak * weakCell = cell; [cell setAppearanceWithBlock:^{ weakCell.containingTableView = tableView; weakCell.leftUtilityButtons = leftUtilityButtons; weakCell.delegate = self; } force:NO]; if (cell==nil) { SWTableViewCell *cell = (SWTableViewCell *)[tableView dequeueReusableCellWithIdentifier:identifier]; if (cell == nil) { cell = [[SWTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reusEIDentifier:identifier containingTableView:self.table // Used for row height and SELEction leftUtilityButtons:leftUtilityButtons rightUtilityButtons:nil]; cell.delegate = self; } return cell; } cell.BACkgroundColor=[UIColor clearColor]; [cell.contentView.layer setBorderColor:[UIColor colorWithRed:0.15f green:0.47f blue:0.17f alpha:0.1].CGColor]; [cell.contentView.layer setBorderWidth:1.0f]; indexvalueRow = indexPath.row; indexValueSection =indexPath.section; friendUser= [self findFriendUser]; [friendUser fetchIfNeededInBACkgroundWithBlock:^(PFObject *object,NSError *error) { if (!error) { if (object) { NSLog(@"friend user = %@",friendUser); NSString *friendName = [NSString StringWithFormat:@"%@ %@",friendUser[@"FirstName"],friendUser[@"LastName"] ]; cell.nameLabel.text= friendName; cell.nameLabel.textColor = [UIColor darkGrayColor]; PFFile *userImageFile = friendUser[@"profilePic"]; [userImageFile getDataInBACkgroundWithBlock:^(NSData *imageData,NSError *error) { if (!error) { //NSLog(@"%@",imageData); cell.profileImage.image = [UIImage imageWithData:imageData]; } }]; }} }]; return cell;
}
以上是大佬教程为你收集整理的ios7 – SWTableViewCell一次显示一个菜单全部内容,希望文章能够帮你解决ios7 – SWTableViewCell一次显示一个菜单所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。