Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2754
  • Last Modified:

Combo box implementation in iphone

The combo box control is not available in the iPhone sdk. What is the best way to simulate the combo box behavior in the IPhone. We need to have 6 combo boxes in our application on one screen. So, I need to create the 150 x 300pixels combo boxes. I tried the UIPicker view controls and customized the m to 150x300.  The look and feel of this is horrible.
  • 2
1 Solution
In a view controller you have a UITextField and a UITableView. Assign the view controller to be the delegate of the both controls, plus the data source of the table.

Implement the UITextField delegate method textField:shouldChangeCharactersInRange:replacementString: in your controller. This intercepts the changes as they are being typed in your text field. In this method, iterate through your list of possible options and store the matches in an NSMutableArray instance variable on your view controller. Then call [myTableView reloadData].

Have your table cells generated from the array of matches you previously stored.

It should be pretty straightforward and shouldn't take much code at all beyond a few delegate methods to get working.

but insted i can recommend you to use this Toolkit :

shore-supportAuthor Commented:
How to add a nice borders to the UITable view?
shore-supportAuthor Commented:
I am able to come up with the solution by following the approach specified.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now