 |
 |
|
 |
07-01-2009, 02:27 PM
|
#1 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 196
|
autocomplete textfield? or combox?
hi i have the next problem.. i need put in mi aplication an controller combox or downdrill or textfield for what user select a choice names the countrys.. the uipicker not works for me beacuse its very bigger.. so i need a combox or textfield whit autocomplete but only names to countrys.. any can help me? i make this i iphone?
|
|
|
07-01-2009, 08:29 PM
|
#2 (permalink)
|
|
Tutorial Author
Join Date: Jun 2009
Posts: 25
|
If you have all the countries in a NSDictionary, you could just display them all in an UITableView. Then bind your class to the outlet of an UITextField and make the class use the UITextFieldDelegate protocol, this way you could use the function textFieldDidBeginEditing: to get the string the user is typing. Then it's just a matter of searching through the NSDictionary with countries and at the end update the UITableView. This will not generate autocomplete functionality, but the only way I know how to do that without seriously subclassing views is to use a UISearchBar.
And of course the class should also use the UITableViewDelegate protocol so that you can get notification when the user has clicked on a cell, in this case a country.
Last edited by Bovn; 07-01-2009 at 08:33 PM.
|
|
|
07-02-2009, 10:49 AM
|
#3 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 196
|
but the problem i what i can show the tableview whit the countrys.. because the work area for the control for countrys its small...
iphone dont manage control combox?
|
|
|
07-02-2009, 11:05 AM
|
#4 (permalink)
|
|
Registered Member
Join Date: May 2009
Location: Sussex, WI, USA
Posts: 20
|
Quote:
Originally Posted by gunther
but the problem i what i can show the tableview whit the countrys.. because the work area for the control for countrys its small...
iphone dont manage control combox?
|
There's no direct support for a control like a combo box; the screen is already small, so popping up a tiny scrolling list of items to choose from is likely to take up most of the screen anyway.
Look at how combo boxes are handled in Safari: when you tap on the combo box on a web page, a picker control pops up. You could take the same approach, or perhaps tapping on that small country field could take the user to a table view where the country could be selected, like Bovn suggests.
Good luck!
|
|
|
07-02-2009, 11:18 AM
|
#5 (permalink)
|
|
Registered Member
Join Date: Nov 2008
Posts: 788
|
Do not try to fit desktop UI onto iPhone.
Instead, redesign your UI so that you can display the list in a tableview.
|
|
|
07-02-2009, 11:36 AM
|
#6 (permalink)
|
|
Tutorial Author
Join Date: Jun 2009
Posts: 25
|
I would just hide a UITableView with all the countries. And when the user clicks on a button to choose a country, you simply display that view. Let's face it; the values are mostly known by the user in advance; if he or she is supposed to choose his/her country, it's only a matter of scrolling down to it. Order them all by name only and you should be fine. Index the table aswell. There is not that many countries in the world to make it neccessary for an autocomplete.
All the interfaces on the web that requires the user to specify their country has a list of them in a select box. People just scroll down fast untill the first letter starts to close up on the first letter of their country.
So take the simple route on this one; the user will expect it and probably only become confused if their suddenly introduced to an autocomplete functionality.
Good luck.
|
|
|
07-02-2009, 01:55 PM
|
#7 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 196
|
ok understand.. but where i do can find an example for this implementation?
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 704 |
| 33 members and 671 guests |
| activ8, AlexTheMighty, asimrs, Breshi, Chilibird, ddzamba, Dracor, dre, flamingliquid, fxshot, hoshimori, iSdkDev, kamath.bharath, lokidil, mac514, mansi5, markbuchanan, MarkC, maverick0, mlfarrell, pereorra, RedM, rocotilos, SamWit, santhoshelectronics, sindhutiwari, sumanth, tonywonghs, tsfrocks, tvromero, vikysaran, wmaximam |
| Most users ever online was 779, 05-11-2009 at 09:55 AM. |
» Stats |
Members: 24,156
Threads: 38,931
Posts: 170,811
Top Poster: smasher (2,565)
|
| Welcome to our newest member, hoshimori |
|