How exactly does one implement two separate "tableviews" on one view like in this image:
alt text http://www.jamespwright.com/images/public/multitableviews.jpg
This is just simple tableView with groupedStyle, numbers of sections = 2 and number of rows is sections - 5 and 2.
It's very, very likely that that is not two table views, but one table in grouped style, with two sections. Please see the Table View Programming Guide and the Human Interface Guide for more.
Related
So I have been scouring the internet but can't find the solution. Currently I have a tableview with collapsable sections, the rows within these sections are off course related to the section. I have two other categories that don't need these collapsable sections, these are just rows. Currently I have a segment control that has the following:
Category 1 (Collapsable sections with each a different number of rows)
Category 2 (Standard list of rows)
Category 3 (Standard list of rows)
Category 4 (all of the above)
Category 1-3 work fine. But I can't combine all in one view. I would like to have three headers with each showing their corresponding category. First header should show all sections that are collapsable. The other two just rows.
What I tried:
Using section count to give each category a header but this ends if giving a header to all sections individually.
Using section count to give each category a view.
Potentially, creating three TableViews for each category if all Segment is selected.
Can anyone help in the right direction to what would be the best solutution.
I don't think my code will help because I'm still not sure what method I should use.
I did make a drawing to show what I mean:
if anyone has an idea that would be fantastic, thanks!
I want to create a page in iphone sdk which looks same as flight search result
problem is that each there are different number of stops some has 2 stops some has 1 etc. and not only leave flight detail but return flight detail can also be asked.
It must sorted on the basis of charges.
I am not getting from where I start
I make 3 custom cells
showing source n destination detail
the flight detail
to make separator between leave n return results
this is demo i have tried with fixed value! [1 row a SimpleTableIdentifier(background color not able to set) 2 and 3 row are 2 different CustemCell, there is separator custom cell too]
but I think i make it complex unnecessary
any tips and help will be apprecited thanks in advance.
Go like this make three customCell one for each of your three category
cell structure to show source and destination detail
cell structure to show flight detail
cell structure to make seperator
Now your UITableView will be a grouped tableView with numberOfSections = number to total flight you have to show
Each section will have three rows (if it has all three information available) else you can reduce the number of rows in any section by delegate method of UITableView named numberOfRowsInSection.
Try not to forget to give all different custom cells other dequeueReusableCellWithIdentifier's for re-usability.
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.
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.
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)? :)