Common Properties of Uipickerview

Source: Internet
Author: User

a . Uipickerview

1. Common properties of Uipickerview

Data source ( used to tell Uipickerview how many columns there are rows )

@property (nonatomic,assign) ID<UIPickerViewDataSource> dataSource;

Agent ( used to tell Uipickerview what to show every 1 rows per 1 columns , monitor Uipickerview 's Choice )

@property (nonatomic,assign) ID<UIPickerViewDelegate> delegate;

// Do you want to display the selected indicator

@property        (nonatomic) BOOL Showsselectionindicator;

// How many columns are there altogether

@property (nonatomic,readonly) Nsinteger numberofcomponents;


2. Common methods of Uipickerview

// re-refresh all columns

-(void) reloadallcomponents;

re-refresh column component

-(void) Reloadcomponent: (Nsinteger) component;


The row row of column component is actively selected

-(void) SelectRow: (Nsinteger) Row incomponent: (Nsinteger) component animated: (BOOL) animated;


get The currently selected line number in column component

-(Nsinteger) Selectedrowincomponent: (Nsinteger) component;


3. Data source Method (Uipickerviewdatasource)

// How many columns are there altogether

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

How many lines are there in column component?

-(Nsinteger) Pickerview: (Uipickerview *) Pickerview numberofrowsincomponent: (nsinteger) component;


4. Proxy method (uipickerviewdelegate)

What is the width of column component?

-(CGFloat) Pickerview: (Uipickerview *) Pickerview widthforcomponent: (nsinteger) component;

What is the row height of column component?

-(CGFloat) Pickerview: (Uipickerview *) Pickerview rowheightforcomponent: (nsinteger) component;


What text is displayed in column component row

-(NSString *) Pickerview: (Uipickerview *) Pickerview Titleforrow: (nsinteger) Row forcomponent: (Nsinteger) component;


Section component row row shows what view ( content )

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


column component row of pickerview was selected

-(void) Pickerview: (Uipickerview *) Pickerview Didselectrow: (nsinteger) Row incomponent: (Nsinteger) Component


two . Uidatepicker

1. Common Properties

display mode for DatePicker

@property (nonatomic) Uidatepickermode Datepickermode;

// display the regional language

@property (nonatomic, retain) Nslocale *locale;


2. Monitor the selection of Uidatepicker

* because Uidatepicker inherits from Uicontrol, so through addTarget: ... Monitor


Three . The complete process of program initiation

1.Main function


2.Uiapplicationmain

* Create uiapplication objects

* Create a uiapplication delegate object


3.delegate object starts processing ( listening ) system events ( no Storyboard)

* When the program is started , the agent's application:didfinishlaunchingwithoptions is called: method

* Create UIWindow in application:didfinishlaunchingwithoptions:

* Create and set UIWindow Rootviewcontroller

* Display window


3. According to Info.plist, get the file name of the most important storyboard, load the main storyboard ( with Storyboard

* Create UIWindow

* Create and set UIWindow Rootviewcontroller

*  Display window


Common Properties of Uipickerview

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.