iOS Development UI Chapter-a brief introduction to the use of static cells

Source: Internet
Author: User

iOS Development UI Chapter-a brief introduction to the use of static cells

First, the realization of the effect and description

Description: Observe the above display effect, you can find the entire interface is a tableview to show, the above data are fixed, and almost will not change.

There are several ways to accomplish the above effect:

(1) You can directly use the code, return three groups, in judging how many rows per group, what data to display, so write "dead" code is not recommended to use.

(2) A little more flexible, you can put the plist file a lazy load of the way, loaded into the program, dynamic access. But looking at the interface structure, it is easy to see that this needs to be nested in the model, very cumbersome.

(3) Storyboard provides a static cell this function, can be very convenient to complete the above interface display effect. (Hint: Rarely used in real-world development)

Second, the use of static cells to complete the simple interface display process

In a similar development, if the entire interface is TableView, the controller inherits from the Uitableviewcontroller directly.

Modify the host controller to inherit from Uitableviewcontroller

Delete the default UIView in storyboard and drag a Viewcontroller directly

When dragged into a viewcontroller, it will have a cell on the default, by default, the cell is dynamic, it is invisible by default.

By setting the cell to static, the resulting note that is set to static cell (static cell) in the content of the properties panel must change this property here.

To associate it with the host controller

Next, you can set the displayed picture and text in turn.

There are two ways to set a title:

1 is double-click Change

2 is click on child control lable Modify

set up the secondary view as required by the interface set How many groups there are, and how many rows each group has. set up groups:Click TableView to set the sections property of the Properties panel.   set how many rows per group: Tip: If the written cell does not change, then you can write a group of one line, then copy, slightly modified. Note: Static cells are actually in development, rarely used, and are only described here as knowledge points.

iOS Development UI Chapter-a brief introduction to the use of static cells

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.