Display UIPickerView when UITextField is clicked
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a screen with many text fields on it. For one particular text field, I need it to show a picker from which the user can pick state names, once the user has picked a state by clicking on the states name, the picker should disappear. I am not quite sure how to do this, I have made the Nib file which looks like this. And here is my header file: #import <UIKit/UIKit.h> #import "APIHelper.h" @interface AddNewAddressViewController : UIViewController < UIPickerViewDelegate , UIPickerViewDataSource , UITextFieldDelegate > {