public class UIPickerView extends UIView
NoIntrinsicMetric
Constructor and Description |
---|
UIPickerView()
Constructs a default UIPickerView object located at (0,0) with 0 weight
and 0 height.
|
UIPickerView(CGRect rect)
Constructs a UIPickerView object initialized with the dimensions and
position specified in the rect parameter.
|
Modifier and Type | Method and Description |
---|---|
UIPickerViewDataSource |
dataSource()
Returns the data source of this picker view.
|
UIPickerViewDelegate |
delegate()
Returns the delegate of this picker view.
|
int |
numberOfComponents()
Returns the number of components that constitute this picker view.
|
int |
numberOfRowsInComponent(int component)
Returns the number of rows(set of values) of this component.
|
void |
reloadAllComponents()
Reload the data of all components.
|
void |
reloadComponent(int component)
Reloads the data of the specified component.
|
CGSize |
rowSizeForComponent(int component)
Returns the size of the row for this component that corresponds to the
largest string or view displayed.
|
int |
selectedRowInComponent(int component)
Returns the selected row of the specified component.
|
void |
selectRow(int row,
int component,
boolean animated)
Sets the specified row of this component as selected using animation or not.
|
void |
setDataSource(UIPickerViewDataSource dataSource)
Sets the data source for this picker view.
|
void |
setDelegate(UIPickerViewDelegate delegate)
Sets the delegate for this picker view.
|
void |
setShowsSelectionIndicator(boolean showsSelectionIndicator)
Sets a Boolean that defines whether selection indicator is displayed.
|
boolean |
showsSelectionIndicator()
Returns a Boolean that shows whether selection indicator is displayed.
|
UIView |
viewForRow(int row,
int component)
Returns the view of the specified row and component.Returns NULL if the
row is not visible.
|
accessibilityIdentifier, addConstraint, addConstraints, addGestureRecognizer, addLayoutGuide, addSubview, alpha, animateWithDuration, animateWithDuration, animateWithDuration, areAnimationsEnabled, autoresizesSubviews, autoresizingMask, backgroundColor, bottomAnchor, bounds, bringSubviewToFront, center, centerXAnchor, centerYAnchor, clipsToBounds, constraints, contentCompressionResistancePriorityForAxis, contentHuggingPriorityForAxis, contentMode, convertPointFromView, convertPointToView, convertRectFromView, convertRectToView, didAddSubview, didMoveToSuperview, didMoveToWindow, drawRect, frame, gestureRecognizers, heightAnchor, hitTest, insertSubview, insetsLayoutMarginsFromSafeArea, intrinsicContentSize, invalidateIntrinsicContentSize, isHidden, isMultipleTouchEnabled, isOpaque, isUserInteractionEnabled, layer, layoutIfNeeded, layoutMargins, layoutMarginsDidChange, layoutMarginsGuide, layoutSubviews, leadingAnchor, leftAnchor, maskView, needsUpdateConstraints, nextResponder, overrideUserInterfaceStyle, pointInside, preservesSuperviewLayoutMargins, removeConstraint, removeConstraints, removeFromSuperview, removeGestureRecognizer, removeLayoutGuide, requiresConstraintBasedLayout, restorationIdentifier, rightAnchor, safeAreaInsets, safeAreaLayoutGuide, sendSubviewToBack, setAccessibilityIdentifier, setAlpha, setAnimationBeginsFromCurrentState, setAnimationCurve, setAnimationDelay, setAnimationDuration, setAnimationRepeatAutoreverses, setAnimationRepeatCount, setAnimationsEnabled, setAnimationStartDate, setAutoresizesSubviews, setAutoresizingMask, setBackgroundColor, setBounds, setCenter, setClearsContextBeforeDrawing, setClipsToBounds, setContentCompressionResistancePriority, setContentHuggingPriority, setContentMode, setFrame, setGestureRecognizers, setHidden, setInsetsLayoutMarginsFromSafeArea, setLayoutMargins, setMaskView, setMultipleTouchEnabled, setNeedsDisplay, setNeedsLayout, setNeedsUpdateConstraints, setOpaque, setOverrideUserInterfaceStyle, setPreservesSuperviewLayoutMargins, setRestorationIdentifier, setTag, setTintAdjustmentMode, setTintColor, setTransform, setTranslatesAutoresizingMaskIntoConstraints, setUserInteractionEnabled, sizeThatFits, sizeToFit, subviews, superview, tag, tintAdjustmentMode, tintColor, tintColorDidChange, topAnchor, toString, trailingAnchor, transform, transitionWithView, translatesAutoresizingMaskIntoConstraints, updateConstraints, updateConstraintsIfNeeded, userInterfaceLayoutDirection, viewForFirstBaselineLayout, viewForLastBaselineLayout, widthAnchor, willMoveToSuperview, willMoveToWindow, willRemoveSubview, window
becomeFirstResponder, isFirstResponder, resignFirstResponder, touchesBegan, touchesCancelled, touchesEnded, touchesMoved
addObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKey
public UIPickerView()
public UIPickerView(CGRect rect)
rect
- CGRect that defines dimension and position of UIPickerView.public int numberOfComponents()
public int numberOfRowsInComponent(int component)
component
- The component for which is the query.public CGSize rowSizeForComponent(int component)
component
- The component for which is the query.public UIView viewForRow(int row, int component)
row
- The row for which is the query.component
- The component for which is the query.public UIPickerViewDataSource dataSource()
public void setDataSource(UIPickerViewDataSource dataSource)
dataSource
- The data source of this picker view.public UIPickerViewDelegate delegate()
public void setDelegate(UIPickerViewDelegate delegate)
delegate
- The delegate for this picker view.public boolean showsSelectionIndicator()
public void setShowsSelectionIndicator(boolean showsSelectionIndicator)
showsSelectionIndicator
- A Boolean that defines whether selection
indicator is displayedpublic void reloadAllComponents()
public void reloadComponent(int component)
component
- The component for which the data are reloaded.public int selectedRowInComponent(int component)
component
- The component for which the selected row is requested.public void selectRow(int row, int component, boolean animated)
row
- The new selected row.component
- The component whose row is selected.animated
- TRUE if selection is animated.Copyright © 2020. All rights reserved.