iPhone: Implementing search and index combo, like Contacts?
iPhone: Implementing search and index combo, like Contacts?
- Subject: iPhone: Implementing search and index combo, like Contacts?
- From: "Michael Dupuis" <email@hidden>
- Date: Tue, 15 Jul 2008 10:48:18 -0400
I'm assuming the NDA has been lifted now, so here goes: I'm trying to
implement a combination search and index list, in the same way that
the 2.0 Contacts application does things, but I'm having trouble
getting anything to work as expected.
The first problem encountered is that you need to shorten the search
field, to accommodate the index along the right-hand side, otherwise
it overwrites the search field. Nothing I do has changed the search
field from spanning the full width though. I'm grabbing the first item
from the UISearchBar subviews, and resizing it in both my controller
init method, and in my viewDidAppear and viewWillAppear methods, but
nothing changes, it always spans the full width when the view is
displayed, even though I've updated the rect (and printing the rect
confirms that I've changed the bounds).
I've also tried setting the autoresizingMask to UIViewAutoresizingNone
thinking that this might be the problem, but this also showed no
change.
Another thing I've noticed is that adding the search field doesn't
automatically add the search icon to the top of the index. I assumed
that it would, but I'm guessing this is also custom code? It'd be
really nice if this were "free". That said, how are we even supposed
to add this icon? You can return the letters for the index, as they
are strings, but I don't see a way to return an image (unicode symbol
maybe?).
I assume I'm not the only one who is trying to emulate this new 2.0
behavior so hopefully this query will help others as well. (Bonus
points for ideas on how to "shift" the index over when the user starts
to type a search string...)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden