how to split a tableview cell into two? - iphone

I like to create a cell like contacts's add instant messages table view, with two cells to select: "AIM" and "home".
May be I can use the custom table cell as the cell's content view, but the table view framework always treats
one table view' cell as a whole, for example ,how to respond to did select row at index path message?

I'm pretty sure that Contacts is using a single cell.
The illusion of two cells is created by a custom cell that contains two buttons each configured to look like a tableveiw cell.

To get the same effect as Tweetie's split cell, create a custom cell and add a Segmented Control and create title and detail labels

Related

Separate buttons in UITable without custom cell

Is it possible to have a UITable with cells that are all the same, each containing buttons that only effect that cell (based on indexPath.row I'm guessing), without having to make a custom cell?
I too need this, but I have a custom cell.
#kaylaGalway your method sounds like it could work for me, could you elaborate? As I have been searching for this answer for hours now (Swift 3)
You can design your table cells freely. It is possible to have a different cell for each and every row within the very same table.
When you have matching cell types for each row you can also add buttons (one or more) in these rows. They can also point to the very same function. With a clever usage of the 'tag' you can identify each individual button. Using the Indexpath.row you can naturally also identify the row in the table.

Customize column of table view

Is it possible to customize the column of table view.
By default table view contains 1 column, But according to my requirement I want 4 column in table.
Means I want table like we create in MS-word/excel.
Thanks.
http://dewpoint.snagdata.com/2008/10/31/drawing-a-grid-in-a-uitableview/
ad
http://usxue.is-programmer.com/posts/14176.html
will help you
No there is no such method to do that ..... but for sure u can make a subclass of UITableViewCell such that it has 4 parts in it and all parts are seperated by a fine line (a kind of bordered image as background will do the job). You can manage your data accordingly and it may create an illusion of MS-word/excel.
But I am sure you are aware of column and row of UITableView, so you can manage all your data is this format. If you want to represent data in tabular fashion like MS-word/excel you don't have enough space as width on iPhone and If you incorporate a tableView in a scroll view, two scroll will not be user friendly.
So i suggest you to go with TableView's native behaviour for such type of task.

Is there a way to stack up the cells of a table side by side?

What i mean by this is that cell1 would be top left. Cell2 would be top right. Cell 3 would be below cell 1, cell 4 would be below cell 2 etc..
Is there a way to do this?
UITableView does not support this out-of-the-box. You can fake it, but you might also want to try using something like AQGridView.
The UITableView only allows for one column, so it's really more of a stack or list than a table. To do what you are talking about you will need to create a custom UITableViewCell either in Interface Builder or code that "fakes" columns through layout, but you will only ever have one cell per row.
From the Documentation:
A table view in the UIKit framework is
limited to a single column because it
is designed for a device with a small
screen.

Does UITableView support grouped style with rectangular (not rounded) sections?

I would like to present a UITableView with a basic layout like this:
header view
table row
table row
table row
header view
table row
table row
Grouped style with section header views is the natural way to do this, but I don't want the "shunken (padding on the left and the right), rounded corner" look that grouped sections have. I'd like the look to be like an indexed plain table: table rows are all rectangular and full-width, with periodic header sections to separate the table rows into groups.
Is this possible with a grouped style table? Or can I simulate this with a plain table and custom content views for the section headers? Or is there another way to do this? I'd like to reuse as much of UITableView as possible, without having to write a full custom control.
I'd go for the second option you presented. What you can do is use the delegate methods viewForHeaderInSection and viewForFooterInSection.

Can I really have just one column in UITableView?

From the docs:
A table view in the UIKit framework is limited to a single column because it is designed for a device with a small screen.
Have look in the developer docuementation A Closer Look at Table-View Cells how to setup multiple columns in a table view cell.
Yes... unless you add subview in cell that looks like more than one column...
i.e 2 label in each cell with same size and horizontally aliened can look like Table with 2 column...
What about putting another tableview next to that one and synchronize the movement (scrolling)? :)