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

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.

Related

Using xcode 6.4, Hide/Unhide rows in TableView sections when there are many sections

I have a Table with many sections and each section also has rows. How can I hide/unhide the rows per section? the table will be easier to manage if the user only sees sections and can 'tap' the section to see the row selections.
Implement tableView(_, numberOfRowsInSection) in the table view's data source to return either 0 (to hide them) or the actual value. Then, in the table view's delegate, implement tableView(_:viewForHeaderInSection:) to return a view that listens for taps.

Table View Group Header View

I want to create an effect similar to the Open Table application. I want the section header to stick to the top as I scroll the table. This is of course the default behavior with a plain table view, but because of style, I want a group table view.
Any ideas or suggestions?
One way to do it (I'd wager OpenTable does it this way) is to use a plain table style but dress the cells yourself as grouped. You'd need 3 background images for the cells, one for the first cell in a section (with rounded upper corners), one for the last row in a section (with rounded lower corners), and one for the others that looks like grouped cells (with left and right insets).

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.

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)? :)

how to split a tableview cell into two?

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