<span id="Label3"></p><p><p>TableView Lan Yi Education</p></p><p><p>1 Create first</p></p><p><p>UITableView *tableview = [[uitableview alloc]initwithframe:self.view.bounds];</p></p><p><p>Tableview.datasource = self;</p></p><p><p>DataSource is the data source</p></p><p><p></p></p><p><p>[self.view addsubview:tableview];</p></p><p><p>2 Creating an agreement</p></p><p><p>@interface Viewcontroller () <</span>UITableViewDataSource></p></p><p><p>3,-(void) didreceivememorywarning{} below @end</p></p><p><p>Tagged #pragma mark uitableviewdelegate classification effect</p></p><p><p>4. Enter the contents of the agreement to the content of the agreement "must" (@required) content method copy out to #pragma mark Uitableviewdelegate category below</p></p><p><p>((numberofsectionsintableview) the following method controls TableView organic Parts)</p></p><p><p>Numberofrowsinsection {} How many lines are there in this section?</p></p><p><p>cellforrowatindexpath{} This method is called every time a row is displayed for the control Tablieview display</p></p><p><p>The code functions in this area are:</p></p><p><p>1. Created a reusable identity cell (difference, tag Action)</p></p><p><p>2, go to the memory to find the cell without leaving the page</p></p><p><p>3, If there is a direct use if not! (cell) then create a</p></p><p><p>Talieview reuse mechanism is: in the interface will display a lot of objects, but in memory only need to be in the number of screens + 1 is enough, because each time the new content is displayed, must be a left page content to replace Him.</p></p><p><p>Control Row Height:</p></p><p><p>The premise is to add tableview.delegate = self in viewdidload; and add another protocol to the original Protocol.</p></p><p><p>And then on the last side of the @end, thank You. control line Height</p></p><p><p>The row heights are getting bigger:</p></p><p><p>---------------------------</p></p><p><p>One of the most common method scenarios:</p></p><p><p>Didselectrowatindexpath ———— Click on a line to do the method</p></p><p><p>Role: Jump Page</p></p><p><p>New:</p></p><p><p>Add Tabelview in SB fullscreen</p></p><p><p>Right-click Delegate DataSource to add the Yellow SB button</p></p><p><p>Add a protocol to the VC</p></p><p><p>And then implement the two methods in the protocol,</p></p><p><p>So at the bottom of the VC added classification #pragma mar ...</p></p><p><p>The first method writes the number of rows</p></p><p><p>The second method creates the label;</p></p><p><p>The effect is that each line has fonts and labels</p></p><p><p>Control ————— responsible for multiple page jumps navigation Controller</p></p><p><p>There is no hierarchical relationship between two pages,</p></p><p><p>Select SB First interface above menu bar edtor--embed in--navigation Controller</p></p><p><p></p></p><p><p>IOS tableview--in Lan Yi Education Study notes</p></p></span>
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