tags:

views:

433

answers:

4

Hello,

So, I can provide a picture in a bit if that would help clarify.

I currently have a UITableView with alot of rows. The first row of the table is a search bar. Great, works fine.

I've just added "plain" indexes, alphabetic headings before each section displayed in the table. I've also added right most index for jumping quickly to any section.

However, since the UISearchBar is part of the of the table (the first element) when the UISearchBar is drawn, it pushes the UISearchBar over a bit, squishing it. It looks silly. One option is not make the UISearchBar part of the table, but I have no where else to put it.

Any idea how to get the right most index to sit over the UISearchBar?

Thanks,

  • sk
A: 

Have you tried to put it into the tableView.tableHeaderView?

catlan
+2  A: 

I usually end up starting out with a UITableViewController subclass, then in the end just turning it into a plain UIViewController subclass so the UITableView is only a part of a more involved view. Just create a view with the search bar at the top, and the table taking up the rest of the space.

Ed Marty
A: 

I am not sure what you mean by "pushing it over a bit" but you can adjust the height of a row by usign the delegate method

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

That might get you a bit more room to play around with. You can also look areound as to where the cell is drawing the UISearchBar in relation to itself and perhaps pretty that up as well.

However I would also recommend going with a ViewController with a tableView and searchView. also if you are a 3.0 developer there could be some new search UI that you may want to look at.

Bluephlame
A: 

Hey, thanks for all the responses. I've been absent cause I'm trying to solve a zlib/gzip issue, which I just did!

So I'll be visiting this tomorrow night probably - I'll post a screenshot w/my problem if I'm unable to solve it.

@Ed Marty - yeah that's a good idea.

@Catlan - Is that a method? Without looking at the code, I'm not sure what you mean.

@Bluephlame: My setup is, TableView, w/TableViewCell->SearchBar.

mr-sk