Why isn't the UIPickerView widthForComponent delegate method called everytime the view appears?

前端 未结 3 1858
慢半拍i
慢半拍i 2021-01-25 08:19

I\'ve got two controls on an iPhone screen - a TableView and a UIPickerView. When you select the single cell in the TableView you\'re taken to another screen where you\'re show

3条回答
  •  隐瞒了意图╮
    2021-01-25 08:34

    I am not sure, but you can try to call [pickerView reloadAllComponents]; in your viewWillAppear method.

      if(currentNumbersOfComponents < 4){
        currentNumbersOfComponents++;
        [picker reloadAllComponents];
    }
    

    The numberOdComponents method returns currentNumberOfComponents

提交回复
热议问题