How To customize different rows in UITableView
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开发者_StackOverflow中文版 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.
精彩评论