Look like iPhone inbuilt contact applications image selection - iphone

I have created an application in which i have to add users to the sqlite database.
Now the problem is I want the look of the standard iPhone Contact application Where while adding user we have the width of first cell smaller than other cells and the image before that cell..
Can you please give me the idea how such thing is possible.
How to make one cell small and rest others of normal size..
Thanks for any help in advance

There are three UITableViewDelegate messages you can listen for to adjust height
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
However, even thought I didn't write Contacts.app I have a feeling they are also using
- (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath
To adjust the views as well. Remember, you don't have to pack everything into a single monolithic custom table view cell. You can create multiple custom table view cells and load them each appropriately depending on the index path.

The contact detail view is a grouped tableview. Each cluster of cells is a section. The top section is a single custom cell with two subviews that look like squashed tableview cells. The left view shows the contact's photo. The right view shows the name.
To reproduce, create a custom UITableView subclass and lay it out like you want either programmatically or in Interface Builder. Then in the tableview delegate's cellForRowAtIndexPath check indexPath.section and return the proper row for the section.

It appears that the Contacts app uses a custom tableHeaderView when presenting the contact details with an image and label. A similar implementation is included in the sample project iPhoneCoreDataRecipes. The RecipeDetailView loads a separate nib in tableViewHeaderView that is used to set the tableView.tableHeaderView property. Have a look at RecipeDetailViewController.{h,m} and DetailHeaderView.xib. When the Contacts app switches to editing mode, the headerView appears to be swapped out for another view that has a button and a tableView with a single cell. This will allow you to set up a separate tableViewDelegate to handle the Name parts of the contact and a delegate to handle the address / telephony details.

Related

How to implement "Loading" in UITableView when scrolling down?

I am working on iPhone application . This application contains plenty of web services. I need to show list in UITableView with page by page. How to show "Loading" and call web service when scrolling down the UITableview ? Please help me..
I assume that you are adding a custom cell to the bottom of your table view to indicate the end of the current data set. When you create that cell, set its tag property to a meaningful constant you've previously defined, like END_OF_TABLE_CELL.
Then use the delegate method tableView:willDisplayCell:forRowAtIndexPath to check if the cell about to display is your custom cell, and trigger a reload of the table's datasource.
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
//check your cell's tag
if (cell.tag == END_OF_TABLE_CELL) {
//Call your custom method to fetch more data and reload the table
// You should also remove this custom cell from the table and add one at the bottom
}
}
This way you will have a table that refreshes itself whenever a user scrolls down far enough to bring the custom cell into view.
Good Luck!

Pinterest's first tab is UITableView or UIWebView?

I wonder which view is used in the next image?
UITableView or UIWebView?
I always wondered how one can tell if a view is embedded inside a web view or not.
Anyway, anyone knows the answer for this specific view?
You can set individual height to individual UITableViewCell using this delegate Method
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;

Indexed UITableView without section header

I'd like to implement a grouped and indexed UITableView without section headers.
I'm using sectionIndexTitlesForTableView:(UITableView *)tableView to return my titles.
I also implemented tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section and returned nil as well as tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section and returned 0.0f.
Both doesn't remove the section headers. There is still a space between the different sections.
I had the same problem and could not find a solution. In the end, I had to subclass UIViewController (not UITableViewController) and use a UITableView with transparent background and the style set to UITableViewStylePlain. Then, I created custom cells for the first and the last row (with rounded corners) and some transparent margin left and right. I can give you more details if you want, but as it does not answer your question straight, I'll just share this link for now.

Custom Section Title View for UITableView

In some apps such as Cool Iris, LiveShare, i see them using custom views for their plain UITableView section titles. Is there a way to replace the standard section title bar with a custom view?
In order to customize the look of your section header, there are two methods you will probably want to use.
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
and
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
These are both found in the UITableView delegate protocol. The first will let you create a custom view to display as your section header. The second just makes sure you get the size you want for it so that your view doesn't get cut off

Custom View in UITableViewCell

I am trying to create a UITableView Section that contains two buttons aligned horizontally. This would be similar to the Contacts app, where on the bottom of a specific contact page they have buttons lined up to Text the contact and share the contact. However in my tableView, I want the two buttons to be placed in between other sections - so i can't set the table's header or footer view? How would i do this?
If I understand the question correct, you want something like this
section 1
your buttons
section 2
For this you can create custom headers/footers for sections instead of table. The methods you might be looking for are in UITableViewDelegate
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
Look into subclassing UITableviewCell class, you can draw your custom view in there and use it, look at the UICatalog sample project in Apple site they do that there a lot