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
Actually, just using setNeedsLayout will also work and might be a bit cleaner.
[picker reloadAllComponents];
[picker setNeedsLayout];
It turns out that if you reset the picker's delegate, the component widths are redrawn each time a selection is made. The modified code looks like this:
-(void)viewWillAppear:(BOOL)animated {
....
self.PopulatePickerArray; // Populate components based on selection
sizePicker.delegate = nil; // NEW CODE
sizePicker.delegate = self; // NEW CODE
[picker reloadAllComponents];
}
Found info on this web page - Changing-Width-UIPicker-Continually
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