Property
Number of rows for the Numberofcomponents (readonly) selection box
DataSource (readonly) Data source
Delegate delegation
(BOOL) Showsselectionindicator whether to display a selection indicator
This selector refers to the selection box on the Pickerview when sliding:
The transparent rectangle above the Adjara, as shown in the figure, is the indicator.
Delegate method
Uipickerviewdelegate
-(void) Pickerview: (uipickerview*) Pickerview Didselectrow: (nsinteger) Row incomponent: (Nsinteger) component
Select Code to execute on row row of the selection box
-(nsstring*) Pickerview: (uipickerview*) Pickerview Titleforrow: (nsinteger) Row forcomponent: (Nsinteger) component
Text displayed for each line
-(uiview*) Pickerview: (uipickerview*) Pickerview Viewforrow: (nsinteger) Row forcomponent: (Nsinteger) component Reusingview: (UIView *) view
Set the view formatting options for the selection box, which can be uiview and UIView subclasses
This method allows you to set a custom view to replace the default display style for each row
-(CGFloat) Pickerview: (uipickerview*) Pickerview rowheightforcomponent: (Nsinteger) component
Set row height
-(CGFloat) Pickerview: (uipickerview*) Pickerview widthforcomponent: (Nsinteger) component
Set line width
Uipickerviewdatasource
Two of the methods in this delegate are required
-(Nsinteger) Numberofcomponentsinpickerview: (Uipickerview *) Pickerview (required)
Set the number of rows to select in the selection box
It's usually one, and you can choose two or more of them at the same time
Similar to the choice of time, there are about two axes to choose at the same time.
-(Nsinteger) Pickerview: (uipickerview*) Pickerview numberofrowsincomponent: (Nsinteger) component (required)
Set the total number of rows in the selection box