First effect chart
Because Xcode in the uipickdate on four modes, there is no only the pattern of years, so when there is a need to use uipickdate feel a bit of a pit, so here to give you the Uipickview use method
This is the initialization Uipickview.
The code is as follows |
Copy Code |
Self.datepick = [[Uipickerview alloc]initwithframe:cgrectmake (kscreenwidth-90,250)];
Self.datePick.delegate =self;
Self.datePick.dataSource = self;
[Selectdateview AddSubview:self.datPick]; |
Then you can implement its proxy method.
The code is as follows |
Copy Code |
-(Nsinteger) Numberofcomponentsinpickerview: (Uipickerview *) pickerview{ } -(Nsinteger) Pickerview: (Uipickerview *) Pickerview numberofrowsincomponent: (Nsinteger) component{ } -(NSString *) Pickerview: (Uipickerview *) Pickerview Titleforrow: (nsinteger) Row forcomponent: (Nsinteger) component{ }
|
This will be able to write this effect!