0

Now I have a table view. It have several rows. In one row, when I click on it, it should popup a picker view from bottom. After choosing, clicking the done button, it would be hidden. And value I picked in the picker should be passed to the row view.

All values in the picker was designed in a NSArray defined in .m file.

Linjiong Cai
  • 83
  • 1
  • 1
  • 5
  • use `didSelectAtRow` method for tableview and check for particular index using `indexpath.row` and if it is desired index then pop up show `pickerview` and hide it when click on `done` – Mohit Aug 06 '14 at 13:38
  • I only know using another view controller to control the pickerView. And all can be done through it. – Linjiong Cai Aug 06 '14 at 13:40
  • thx Mohit, I have used this method to pass value to the label. But it is in another view controller, not in the same one. – Linjiong Cai Aug 06 '14 at 13:42
  • then push to that view controller and on done pop it back – Mohit Aug 06 '14 at 13:44
  • What I want is in the same controller, not two controllers. In one controller, click the view, picker popup, choose the value, click the done button, it is hidden, value is shown on the view. – Linjiong Cai Aug 06 '14 at 13:45
  • you can do that same as i told you in my first comment. you can do this with the help of that solution – Mohit Aug 06 '14 at 13:46
  • If I do so, how to design the storyboard? How to response the picker/ – Linjiong Cai Aug 06 '14 at 13:49
  • add the picker over tableview, make it hidden on initial stage and show it when desired row selected. make it hidden again when done clicked – Mohit Aug 06 '14 at 13:51
  • Yeah, I know this way. What I confused is if I drag a Picker View into the table, it takes a lot of space. If it is hidden, the blank would still be there. If I make a view at the bottom of the table view. It still has blank when it is hidden. – Linjiong Cai Aug 06 '14 at 13:56
  • did you set any background color? – Mohit Aug 06 '14 at 14:04
  • It is default color. Should I put it at the bottom of the table view? – Linjiong Cai Aug 06 '14 at 14:08

0 Answers0