1

I'm currently coding an iPhone app and i need to simulate a HTML select.

The app is a port of a web application which allows the user to select different units of measurement. For example, a user can select 'Millimetres' or 'Inches'. This is nice and simple in HTML as a select is perfect for the job, but how do i present this choice to the user of an iPhone app as there is no such thing as a select in UIKit?

Gary Willoughby
  • 50,926
  • 41
  • 133
  • 199

2 Answers2

1

The closest option (and the standard one used for such things) is a UIPickerView.

If you're after sample code, see the "Related sample code" section in the header of the above linked document.

In terms of presentation, you could use a UIActionSheet to present the UIPickerView - there's a good question/answer already for this at Add UIPickerView & a Button in Action sheet - How?

Community
  • 1
  • 1
John Parker
  • 54,048
  • 11
  • 129
  • 129