[UIPickerView case 04 - random ordering perfect Objective-C language]

1. Where did we talk about before?

notify

1) First, build the interface

2) Then, it is to load data

notify

First drag this data file in, and then set its proxy object and data source object

Then, in the controller, follow the corresponding protocol,

notify

Implement the corresponding method

It is the same as the idea of ​​TableView,

Also, how many rows to return

notify

how many groups to put, return

Then, how many rows per group

Then, what is displayed on each line

notify

3) Then, do you order food randomly? Next, order food randomly

notify

First, draw a line for it

notify

Drag an event, in this event, traverse all the data, how many groups to traverse

i, is the corresponding, the first group, the second group, the third group

Then, let this group of data be randomly selected

1. The next step is to display the data on the Label,

notify

In this Main.storyboard, the constraint of this Label is from the one on the left,

notify

Here, there is a shortcut key called: hold down the Control key, and then, drag it over

notify
notify

The Horizontal Spacing

is the distance from the horizontal

There is also a Vertical Spacing, just below us

notify

Guess you like

Origin blog.csdn.net/madoca/article/details/132662331