Hello,
I have an UIPickerView that works fine and loads its data from separate arrays. Using XCode 7.1 and Objective-C for iOS development targeted for iOS 9.3.
One of the rows is of just plain string text. The other row of png images. The images are 200 by 200 pixes each. The preferred row height I have then is:
- (CGFloat) pickerView: (UIPickerView *) pickerView rowHeightForComponent:(NSInteger)component
{
if(component == wordPicker){ //checks for component of words to set that as appropriate row height
return 60.0;
}
else{ //checks for component of images imagePicket to set 200 as appropriate row height.
return 200.0;
}
However, even though this logic is similarly and successfully implemented for "widthForComponent," the rowHeightForComponent has the effect of setting up the heighest row value as the row height for both picker row components. As a result the image picker row is displayed as expected, yet the word picker next to it has same 200 pixels height, and words' cells are large enough that the words above and below can't be seen unless scrolled through...
I have experimented with several suggestions of using reloadAllComponents method, setting up a for loop to force independent row heights. None has worked. And searched through the internet and this forum and couldn't find a definitive answer.
Am I trying to do something iOS doesn't support with its delegate methods and current framework for UIPickerView? Or am I missing a key method?
At this point I am inclined to attempt multiple Pickers in the same class.