目前,我有一个UITableViewController分组选项。我正在尝试创建类似于地址簿UI的配置文件联系人图片及其名称相邻的名称。 有没有办法在公司名称上方添加个人资料照片以及除图片之外的人的姓名?任何示例或Apple Book Reference都会有所帮助。如何在UITableViewGrouped上创建联系人档案图片iphone
0
A
回答
0
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
// Create
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
//cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
}
// Configure
switch (indexPath.row) {
case 0:
cell.textLabel.text = @" Evolutions";
cell.backgroundColor=[UIColor clearColor];
cell.textLabel.textColor=[UIColor whiteColor];
CGRect myImageRect =CGRectMake(20,10,75,80);
UIImageView *imageView = [[UIImageView alloc] initWithFrame:myImageRect];
[imageView setImage:[UIImage imageNamed:@"page-1.jpg"]];
[cell addSubview :imageView];
[imageView release];
UIButton *btnView= [UIButton buttonWithType:UIButtonTypeRoundedRect];
[btnView addTarget:self action:@selector(View:)forControlEvents:UIControlEventTouchDown];
[btnView setTitle:@"View" forState:UIControlStateNormal];
[btnView setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
btnView.frame=CGRectMake(235,36, 72,30);
[ cell addSubview: btnView];
break;
我有ü要创建通讯录这样的图像,然后使用此代码。
0
的代码来获取名称和联系人的图像,为后续
+ (NSMutableArray *) getAllContacts {
// Fetch the address book
ABAddressBookRef addressBook = ABAddressBookCreate();
NSArray *people = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);
NSMutableArray *contacts = [NSMutableArray array];
for (CFIndex i = 0; i < [people count]; i++) {
ABRecordRef record = [[people objectAtIndex:i] retain];
NSString *fullname =(NSString *)ABRecordCopyCompositeName(record);
NSMutableDictionary *dict = [NSMutableDictionary dictionary] ;
if (![contacts containsObject:fullname]) {
[dict setValue:fullname forKey:@"name"];
changes = YES;
}
if (ABPersonHasImageData(record)) {
UIImage *image = [UIImage imageWithData:(NSData *)ABPersonCopyImageData(record)];
[dict setObject:image forKey:@"image"];
changes = YES;
}
CFRelease(record);
[fullname release];
}
CFRelease(addressBook);
[people release];
return contacts;
}
至于电池,只需设置cell.imageView.image和cell.textLabel.text为接触式图像和联系人姓名。如果您需要进一步定制,请尝试避免已实施的样式并创建自己的样式。
相关问题
- 1. iPhone联系人图片
- 2. 在Objective-C中创建iPhone联系人
- 3. 如何在创建新联系人时设置RAW_CONTACT_ID联系人
- 4. 如何使用Ionic联系人显示联系人图片
- 5. 如何使用联系人ID检索联系人图片
- 6. Google联系人API:如何获取google api联系人图片?
- 7. 如何在android中创建联系人
- 8. 如何在android中创建一个listview作为iphone联系人?
- 9. 如何在iphone SDK中创建联系人?
- 10. 如何在iphone中创建联系人二维码
- 11. 如何为联系人添加图片?
- 12. 联系人视图iphone SDK
- 13. 如何创建像iphone联系人地址单元的UITableViewCell?
- 14. 如何重新创建iPhone的联系人列表UITableView
- 15. Android联系人图片
- 16. 如何创建谷歌联系人?
- 17. 如何自动创建联系人?
- 18. 创建新的联系人视图
- 19. 如何在android中创建联系人视图界面?
- 20. 如何从iPhone联系人中仅提取WhatsApp联系人?
- 21. 无法使用联系人框架创建联系人的电子名片
- 22. 联系人创建问题
- 23. 创建联系人数据
- 24. 如何显示联系人ID的联系人照片?
- 25. 在imageview中显示联系人图片。
- 26. 获取Twitter个人档案图片
- 27. 如何在联系人上查询联系人Android
- 28. iphone联系照片
- 29. CNContact保存联系人时不会发送联系人图片
- 30. 使用联系人ID设置联系人图片