Protocol: UIPickerViewDelegate
Overview
The delegate of a UIPickerView object must adopt this protocol and implement at least some of its methods to provide the picker view with the data it needs to construct itself.Called by the picker view when it needs the styled title to use for a given row in a given component.Called by the picker view when the user selects a row in a component.Called by the picker view when it needs the row height to use for drawing row content.Called by the picker view when it needs the title to use for a given row in a given component.Called by the picker view when it needs the view to use for a given row in a given component.Called by the picker view when it needs the row width to use for drawing row content.
Instance Method Summary (collapse)
-
- pickerView:attributedTitleForRow:forComponent:
Called by the picker view when it needs the styled title to use for a given row in a given component.
-
- pickerView:didSelectRow:inComponent:
Called by the picker view when the user selects a row in a component.
-
- pickerView:rowHeightForComponent:
Called by the picker view when it needs the row height to use for drawing row content.
-
- pickerView:titleForRow:forComponent:
Called by the picker view when it needs the title to use for a given row in a given component.
-
- pickerView:viewForRow:forComponent:reusingView:
Called by the picker view when it needs the view to use for a given row in a given component.
-
- pickerView:widthForComponent:
Called by the picker view when it needs the row width to use for drawing row content.
Instance Method Details
- (NSAttributedString) pickerView(pickerView, attributedTitleForRow:row, forComponent:component)
Called by the picker view when it needs the styled title to use for a given row in a given component. If you implement both this method and the pickerView:titleForRow:forComponent: method, the picker view prefers the use of this method. However, if your implementation of this method returns nil, the picker view falls back to using the string returned by the pickerView:titleForRow:forComponent: method.
- (Object) pickerView(pickerView, didSelectRow:row, inComponent:component)
Called by the picker view when the user selects a row in a component. To determine what value the user selected, the delegate uses the row index to access the value at the corresponding position in the array used to construct the component.
- (Float) pickerView(pickerView, rowHeightForComponent:component)
Called by the picker view when it needs the row height to use for drawing row content.
- (String) pickerView(pickerView, titleForRow:row, forComponent:component)
Called by the picker view when it needs the title to use for a given row in a given component. If you implement both this method and the pickerView:attributedTitleForRow:forComponent: method, the picker view prefers the pickerView:attributedTitleForRow:forComponent: method. However, if that method returns nil, the picker view falls back to using the string returned by this method.
- (UIView) pickerView(pickerView, viewForRow:row, forComponent:component, reusingView:view)
Called by the picker view when it needs the view to use for a given row in a given component. If the previously used view (the view parameter) is adequate, return that. If you return a different view, the previously used view is released. The picker view centers the returned view in the rectangle for row.
- (Float) pickerView(pickerView, widthForComponent:component)
Called by the picker view when it needs the row width to use for drawing row content.