現在、私はグループ化されたオプションでUITableViewControllerを持っています。私はそれに隣接するプロフィールの連絡先の写真とその名前を持つアドレス帳のUIに似た何かを作成しようとしています。 会社名の上にプロフィール画像を追加する方法はありますか?すべての例またはApple Book Referenceが参考になります。iphoneでUITableViewGroupedの連絡先プロフィール画像を作成する方法
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;
私はuがこのコードを使用し、この画像のようにアドレス帳を作成する必要があります。
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. 連絡先のようなコンポジションの画像連絡先のアプリ
- 3. iOS連絡先画像をフルスクリーンで表示する方法
- 4. プログラムで連絡先をiphone連絡先リストに追加する
- 5. Androidの連絡先:姓、名字、画像で連絡先リストを取得する方法
- 6. VSTOでカスタム連絡先フォルダを作成する方法は?
- 7. 連絡先monodroidのサムネイル画像のパス
- 8. Googleの連絡先を作成する
- 9. アンドロイド:連絡先に画像を添付
- 10. iphoneアプリでGmailの連絡先を取得する方法
- 11. プログラムでOutlook 2010で連絡先の画像を取得する方法?
- 12. iphoneの連絡先リストの操作方法
- 13. iPhoneでObjective-Cの連絡先画像へのパスを見つける
- 14. iphone連絡先から連絡先をテーブルビューに追加
- 15. 連絡先リスト内の連絡先をすべて削除する方法
- 16. iphone連絡先からインスタントメッセージアドレスを取得する方法
- 17. 連絡先の作成時間の取得方法
- 18. iphone連絡先がGoogleマップのアドレスを見つける方法
- 19. Webaphereポータル8.5:連絡先フォームの作成方法
- 20. Glasswareの連絡先の画像を更新するには?
- 21. アンドロイドで連絡先の画像を変更しますか?
- 22. 連絡先の画像を変更するとき
- 23. Cordova連絡先プラグインを使用してユーザーの連絡先に画像を保存する
- 24. 連絡先でカスタムのスクロールバーイメージとA-Zエフェクトを作成する方法は?
- 25. 連絡先情報から特定の電話番号のプロフィール画像を取得する
- 26. Androidの連絡先連絡先遅い
- 27. 連絡先に画像を添付する
- 28. howto iPhoneの連絡先ヘッダーのスクロールを作成するhtmlの効果?
- 29. iPhoneへのFacebookの連絡先のインポート方法
- 30. gmailの連絡先のruby on accessトークンを作成する方法