Overview of how iOS selector view Controls (Uipickerview) are used

Source: Internet
Author: User

Summary of Uipickerview usage in iOS

Uipickerview is a native selector control in iOS that is easy to use, simple in usage, and beautifully effective.

@property (nonatomic,assign) ID<uipickerviewdatasource> DataSource;

@property(nonatomic,assign) ID<uipickerviewdelegate> Delegate

Set up data sources and proxies

@property (nonatomic) BOOL Showsselectionindicator;

Whether the selection box is displayed, this property has no effect after iOS7

@property(nonatomic,readonly) nsinteger numberofcomponents;

Get the number of partitions

-(Nsinteger) numberofrowsincomponent: (nsinteger) component;

Gets the number of rows for a partition

-(cgsize) rowsizeforcomponent: (nsinteger) component;

Get the dimensions of a partition row

-(UIView *) Viewforrow: (nsinteger) row forcomponent: (nsinteger) component;

Get a view of a row in a partition

-(void) reloadallcomponents;

Reload All partitions

-(void) Reloadcomponent: (nsinteger) component;

Overloading a partition

-(void) SelectRow: (nsinteger) row incomponent: (nsinteger) component animated: (BOOL ) animated;

Set a row to select a partition

-(Nsinteger) selectedrowincomponent: (nsinteger) component;

Returns a selected row of a partition


Methods in the data source proxy:

-(Nsinteger) Numberofcomponentsinpickerview: (uipickerview *) Pickerview;

Set Number of partitions

-(Nsinteger) Pickerview: (uipickerview *) Pickerview numberofrowsincomponent: (nsinteger) Component

Set the number of rows by partition


Methods in the proxy:

-(cgfloat) Pickerview: (uipickerview *) Pickerview widthforcomponent: (nsinteger) Component

Set the partition width

-(cgfloat) Pickerview: (uipickerview *) Pickerview rowheightforcomponent: (nsinteger) Component

Set Partition Row Height

-(nsstring *) Pickerview: (uipickerview *) Pickerview Titleforrow: (nsinteger) row Forcomponent: (nsinteger) component;

Set the caption displayed for a row

-(nsattributedstring *) Pickerview: (uipickerview *) Pickerview Attributedtitleforrow: ( Nsinteger) Row forcomponent: (nsinteger) component;

To set the caption displayed by a row through a property string


-(UIView *) Pickerview: (uipickerview *) Pickerview Viewforrow: (nsinteger) Row forcomponent :(Nsinteger) component Reusingview: (UIView *) view;

Set the view view displayed for a row


-(void) Pickerview: (uipickerview *) Pickerview Didselectrow: (nsinteger) row incomponent: ( Nsinteger) Component

Callback that is executed when a row is selected


Overview of how iOS selector view Controls (Uipickerview) are used

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.