IOS Custom Cell Transcripts--learning notes in Lan Yi education

Source: Internet
Author: User

1, SB Add a TV, arrow, Cell, create TVC and associate

2, establish student object, in. The string name is established in H, and the number of words is English;

3. Create an array in TVC, the object of the student, initialize,

Get string and content (TXT file)

Split string

Traverse to get each line, get each row and then split

Each line is to create a student,

The number of each student's name language score

Add the created student object to the array

4, line number, content,

Remove each line of student object,

Then Cell,textlabel.text =.

The name is now displayed.

5. Create Tableviewcell

Name of the cell in the associated SB

Drag the label to the interface to change each color

6, connect to STUNDENTVC. H is related to this

Return to tic-associated cell, then delete Textlabel in the display content method (because the code takes precedence, will cover SB)

And then set the display of each label, at this point will be displayed at this time to cut the display content of four, to cell,h in the Layoutsubviews method, (this method will be called before each display)

In the method again, add "Super layoutsubviews" (translate the original things to be added)

Paste four contents, change the cell to self, and then student. The student attribute is declared in H, which is then passed to the cell inside the--cell in TVC. s = s;

equivalent = self.student "index path. Row ",

And then back to the cell. H can be written in =self ...

———— was created by SB.

IOS Custom Cell Transcripts--learning notes in Lan Yi education

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.