ABUnknownPersonViewController *unknownPersonViewController = [[ABUnknownPersonViewController alloc] init];
unknownPersonViewController.view.frame = CGRectMake(0, 20, 320, 400);
//unknownPersonViewController.displayedPerson = (ABRecordRef)[self buildContactDetails];
unknownPersonViewController.allowsAddingToAddressBook = YES;
UIButton *cancelBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
cancelBtn.frame = CGRectMake(262, 6, 54,30);
[unknownPersonViewController.view addSubview:cancelBtn];
[self presentModalViewController:unknownPersonViewController animated:YES];
[unknownPersonViewController release];
i am using UIViewcontroller and in this code i want that a bar like navigation bar will show in upper
side of this controller so i want to put cancel button on that bar.any help?
What you should do is embed your
ABUnknownPersonViewControllerin a UINavigationControllerThat way you wouldn’t even have to add the button yourself, the
ABUnknownPersonViewControllerwould take care of it for you.For more info check Address Book Programming