CN107329795A - A kind of TableView optimization methods - Google Patents
A kind of TableView optimization methods Download PDFInfo
- Publication number
- CN107329795A CN107329795A CN201710484430.9A CN201710484430A CN107329795A CN 107329795 A CN107329795 A CN 107329795A CN 201710484430 A CN201710484430 A CN 201710484430A CN 107329795 A CN107329795 A CN 107329795A
- Authority
- CN
- China
- Prior art keywords
- tableview
- section
- created
- optimization methods
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/443—Optimisation
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention relates to a kind of TableView optimization methods, including:Refreshable tableview is created, RefreshTableView is named as, in RefreshTableView, refresh framework using EGO to be refreshed, it is corresponding to create EGORefresh Delegate, in RefreshTableView, Section is created, wherein including:It is used as the Layout of TableView data-drivens, the cell of driving is shown as TableView, in Section, reusable TableView Section are created, ReuseSection are named as, in Section, create not reusable TableView Section, Un ReuseSection are named as, in Section, Block is created and is used with simplifying TableView.The present invention, is prevented effectively from interim card, falls the phenomenons such as frame, it is to avoid crash, supports User Defined Show Styles, it is ensured that the fluency of TableView data Layers and display layer.
Description
Technical field
The present invention relates to UITableView(Abbreviation TableView)Performance Optimization technique field, specifically one kind
TableView optimization methods.
Background technology
UITableView is commonly used control in app exploitations, and function is very powerful, is used for the display of data.
UITableView is inherited from UIScrollView, can show as two kinds of styles of Plain and Grouped.
UITableView has two Delegate to be respectively:DataSource and delegate.
DataSource is UITableViewDataSource types, and predominantly UITableView provides the number of display
According to (UITableViewCell), specify edit operation type that UITableViewCell supports (insert, delete and
Reordering), and corresponding data are carried out according to the operation of user and updates operation, if data are carried out just not according to operation
True renewal, may result in display exception, or even crush(Collide, conflict).
Delegate is UITableViewDelegate types, some optional methods is mainly provided, for controlling
The display and assistance of the TableView head and tail for selecting, specifying section complete the functions such as cell deletion and sequence.
UITableView is mentioned, it is just necessary say one say NSIndexPath.UITableView states one
NSIndexPath classification, is mainly used to identify the current cell position in TableView, the category have section and
Two attributes of row, the former identifies current cell and is in which section, and which in the section the latter represent
OK.
UITableView can only have a column data (cell), and only support longitudinal sliding motion, as the TableView created
When display for the first time, it would be desirable to call its reloadData method, force to refresh once, so that TableView
Data, which update, arrives last state.
UITableViewController is the convenient class that system is provided, primarily to facilitating us to use
UITableView, such generation when just by itself be arranged to its TableView included dataSource and
Delegate, and the framework of many proxy functions is created, the time is greatly saved for us, we can be by it
TableView attributes obtain the TableView objects of the Controller internal maintenances.Used under default situations
The TableView that UITableViewController is created is filled with full frame, and it is not fill that TableView is used if desired
It is full it is full frame if, we should use UIViewController to create and safeguard TableView ourselves.
UITableViewController provides an initialization function initWithStyle:It is, as needed that we can
To create the TableView of Plain or Grouped types, when we using its from UIViewController successions come
When init initialization functions, acquiescence will we create the TableView of a Plain type.
Each unit shown in UITableView is a UITableViewCell object, its initialization function
initWithStyle:reuseIdentifier:Compare especially, the UIView usually seen with us initialization function is not
Together.This is primarily to efficiency considers, because during the slip of TableView quick slidings, frequently alloc pairs
As if it is relatively time-consuming, in the reuse mechanism for being the introduction of cell, this be also we in dataSource will it is important to note that
Place, make good use of reuse mechanism can let us TableView slide get up it is more smooth.
Display styles when we can be chosen by the cell specified cell of selectionStyle attributes, and pass through
AccessoryType is to specify the content of the display on the right of cell, or directly specifies accessoryView to show to customize the right
The view shown.
The UITableView that system is provided contains the layout of four kinds of styles, it is envisaged that it is simply most normal that system is provided
Several types, when the style that system is provided, which does not meet us, to be needed, we are accomplished by being customized cell,
There are following two customization modes optional:
1st, directly subView is added to above cell contentView
2nd, from UITableViewCell derive from a class, can more depth one cell of customization, it is possible to specify cell enter
It is how corresponding etc. when edit patterns.Simplest implementation is exactly that all contents to be drawn are put into a customization
SubView in, and heavy duty subView drawRect methods directly draw out the content to be shown and (so may be used
With performance bottleneck caused by avoiding subView excessive), finally the subView is added in cell derived class again
In contentView.
Both customizations cell method, subView is added on cell contentView, rather than
It is applied directly to above cell.
TableView's in use, normal can run into problems with:Screen falls the phenomenons such as frame, interim card.These phenomenons are significantly
The performance for the reducing user experience of degree, and improve crash frequency.Therefore, it is appropriate TableView is optimized it is non-
It is often necessary.
For example:, will when thering are a large amount of pictures and other controls to need loading in quick sliding TableView and cell
Occur seriously falling frame, sometimes can also crash.
The content of the invention
For defect present in prior art, it is an object of the invention to provide a kind of TableView optimization methods, have
Effect avoid interim card, fall the phenomenons such as frame, it is to avoid crash, support User Defined Show Styles, it is ensured that TableView data Layers and
The fluency of display layer.
To achieve the above objectives, the present invention is adopted the technical scheme that:
A kind of TableView optimization methods, it is characterised in that including:
Refreshable tableview is created, RefreshTableView is named as,
In RefreshTableView, refresh framework using EGO and refreshed, EGORefresh is created accordingly
Delegate,
In RefreshTableView, Section is created, wherein including:
As the Layout of TableView data-drivens,
The cell of driving is shown as TableView,
In Section, reusable TableView Section are created, ReuseSection is named as,
In Section, not reusable TableView Section are created, Un ReuseSection are named as,
In Section, create Block and used with simplifying TableView, the Block includes:
TableView data-drivens are encapsulated,
TableView display drivings are encapsulated,
TableView basic logics are encapsulated,
Encapsulate TableView basic elements.
On the basis of above-mentioned technical proposal, the Layout as TableView data-drivens supports user to make by oneself
Adopted Data Styles.
On the basis of above-mentioned technical proposal, the parsing to User Defined Data Styles is handled using background thread.
On the basis of above-mentioned technical proposal, the cell that driving is shown as TableView supports User Defined
Show Styles.
On the basis of above-mentioned technical proposal, in TableView in use, directly using Section, Section is utilized
In Block simplify TableView use.
On the basis of above-mentioned technical proposal, using Section as TableView cache drivers, wherein:
The Plain single Section of correspondence in TableView base models,
The multiple Section of Grouped correspondences in TableView base models.
TableView optimization methods of the present invention, are prevented effectively from interim card, fall the phenomenons such as frame, it is to avoid crash, support
User Defined Show Styles, it is ensured that the fluency of TableView data Layers and display layer.
Brief description of the drawings
The present invention has drawings described below:
The Organization Chart of Fig. 1 present invention.
Embodiment
The present invention is described in further detail below in conjunction with accompanying drawing.
As shown in figure 1, TableView optimization methods of the present invention, including:
Refreshable tableview is created, RefreshTableView is named as,
In RefreshTableView, refresh framework using EGO and refreshed, EGORefresh is created accordingly
Delegate,
In RefreshTableView, Section is created, wherein including:
As the Layout of TableView data-drivens,
The cell of driving is shown as TableView,
In Section, reusable TableView Section are created, ReuseSection is named as,
In Section, not reusable TableView Section are created, Un ReuseSection are named as,
In Section, create Block and used with simplifying TableView, the Block includes:
TableView data-drivens are encapsulated,
TableView display drivings are encapsulated,
TableView basic logics are encapsulated,
Encapsulate TableView basic elements.
On the basis of above-mentioned technical proposal, the Layout as TableView data-drivens supports user to make by oneself
Adopted Data Styles.
On the basis of above-mentioned technical proposal, the parsing to User Defined Data Styles is handled using background thread.
On the basis of above-mentioned technical proposal, the cell that driving is shown as TableView supports User Defined
Show Styles.
On the basis of above-mentioned technical proposal, in TableView in use, directly using Section, Section is utilized
In Block simplify TableView use.
On the basis of above-mentioned technical proposal, using Section as TableView cache drivers, wherein:
The Plain single Section of correspondence in TableView base models,
The multiple Section of Grouped correspondences in TableView base models.
The content not being described in detail in this specification belongs to prior art known to professional and technical personnel in the field.
Claims (6)
1. a kind of TableView optimization methods, it is characterised in that including:
Refreshable tableview is created, RefreshTableView is named as,
In RefreshTableView, refresh framework using EGO and refreshed, EGORefresh is created accordingly
Delegate,
In RefreshTableView, Section is created, wherein including:
As the Layout of TableView data-drivens,
The cell of driving is shown as TableView,
In Section, reusable TableView Section are created, ReuseSection is named as,
In Section, not reusable TableView Section are created, Un ReuseSection are named as,
In Section, create Block and used with simplifying TableView, the Block includes:
TableView data-drivens are encapsulated,
TableView display drivings are encapsulated,
TableView basic logics are encapsulated,
Encapsulate TableView basic elements.
2. TableView optimization methods as claimed in claim 1, it is characterised in that:It is described to be used as TableView data-drivens
Layout, support User Defined Data Styles.
3. TableView optimization methods as claimed in claim 2, it is characterised in that:To the solution of User Defined Data Styles
Analysis is using background thread processing.
4. TableView optimization methods as claimed in claim 1, it is characterised in that:Described shown as TableView drives
Cell, support User Defined Show Styles.
5. TableView optimization methods as claimed in claim 1, it is characterised in that:In TableView in use, directly making
With Section, simplify TableView using the Block in Section and use.
6. TableView optimization methods as claimed in claim 1, it is characterised in that:Delay Section as TableView
Driver is deposited, wherein:
The Plain single Section of correspondence in TableView base models,
The multiple Section of Grouped correspondences in TableView base models.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710484430.9A CN107329795A (en) | 2017-06-23 | 2017-06-23 | A kind of TableView optimization methods |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710484430.9A CN107329795A (en) | 2017-06-23 | 2017-06-23 | A kind of TableView optimization methods |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107329795A true CN107329795A (en) | 2017-11-07 |
Family
ID=60195798
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710484430.9A Pending CN107329795A (en) | 2017-06-23 | 2017-06-23 | A kind of TableView optimization methods |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107329795A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108391075A (en) * | 2018-02-27 | 2018-08-10 | 北京酷我科技有限公司 | A kind of method that video playing Cell refreshes without interval |
CN108694066A (en) * | 2018-05-09 | 2018-10-23 | 北京酷我科技有限公司 | A kind of method that tableView delays refresh |
CN108733447A (en) * | 2018-05-28 | 2018-11-02 | 北京酷我科技有限公司 | A kind of video details page animation deployment algorithm |
CN108762866A (en) * | 2018-05-09 | 2018-11-06 | 北京酷我科技有限公司 | A kind of method that short audio rolling shows |
CN109634490A (en) * | 2018-12-14 | 2019-04-16 | 北京字节跳动网络技术有限公司 | A kind of list display method, device, equipment and storage medium |
CN110489191A (en) * | 2019-07-30 | 2019-11-22 | 广东分利宝金服科技有限公司 | The packaging method and device of the palace lattice view of calling easy of integration |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105677366A (en) * | 2016-02-26 | 2016-06-15 | 四川长虹电器股份有限公司 | Method for achieving infinite circulating rolling selection based on UITableView in iOS |
CN105740478A (en) * | 2016-03-25 | 2016-07-06 | 浪潮通用软件有限公司 | Method and device for realizing paging sorting table without refreshing |
CN105955777A (en) * | 2016-05-03 | 2016-09-21 | 网易(杭州)网络有限公司 | User interface refreshing method and device |
-
2017
- 2017-06-23 CN CN201710484430.9A patent/CN107329795A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105677366A (en) * | 2016-02-26 | 2016-06-15 | 四川长虹电器股份有限公司 | Method for achieving infinite circulating rolling selection based on UITableView in iOS |
CN105740478A (en) * | 2016-03-25 | 2016-07-06 | 浪潮通用软件有限公司 | Method and device for realizing paging sorting table without refreshing |
CN105955777A (en) * | 2016-05-03 | 2016-09-21 | 网易(杭州)网络有限公司 | User interface refreshing method and device |
Non-Patent Citations (4)
Title |
---|
CHEN_YILONG: ""IOS详解TableView——内置刷新,EGO,以及搜索显示控制器"", 《博客园》 * |
喝着咖啡敲代码: ""代码实现有多个section的tableview"", 《简书》 * |
江文帆: ""编写整洁的TableView代码--基于Block的TableView CollectionView数据源封装"", 《简书》 * |
番薯大佬: ""UITableView的使用(UITableViewCell\section页眉\section页脚复用、sectionHeaderView点击效果)"", 《CSDN》 * |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108391075A (en) * | 2018-02-27 | 2018-08-10 | 北京酷我科技有限公司 | A kind of method that video playing Cell refreshes without interval |
CN108391075B (en) * | 2018-02-27 | 2020-10-30 | 北京酷我科技有限公司 | Method for refreshing video playing Cell without interval |
CN108694066A (en) * | 2018-05-09 | 2018-10-23 | 北京酷我科技有限公司 | A kind of method that tableView delays refresh |
CN108762866A (en) * | 2018-05-09 | 2018-11-06 | 北京酷我科技有限公司 | A kind of method that short audio rolling shows |
CN108694066B (en) * | 2018-05-09 | 2021-04-27 | 北京酷我科技有限公司 | TableView delayed refreshing method |
CN108733447A (en) * | 2018-05-28 | 2018-11-02 | 北京酷我科技有限公司 | A kind of video details page animation deployment algorithm |
CN108733447B (en) * | 2018-05-28 | 2021-06-29 | 北京酷我科技有限公司 | Video detail page animation expansion algorithm |
CN109634490A (en) * | 2018-12-14 | 2019-04-16 | 北京字节跳动网络技术有限公司 | A kind of list display method, device, equipment and storage medium |
WO2020119800A1 (en) * | 2018-12-14 | 2020-06-18 | 北京字节跳动网络技术有限公司 | List display method, apparatus and device, and storage medium |
CN110489191A (en) * | 2019-07-30 | 2019-11-22 | 广东分利宝金服科技有限公司 | The packaging method and device of the palace lattice view of calling easy of integration |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107329795A (en) | A kind of TableView optimization methods | |
CN114035773B (en) | Configuration-based low-code form development method, system and device | |
US20070126741A1 (en) | Techniques for automated animation | |
CN105487864A (en) | Method and device for automatically generating code | |
JPH0546600A (en) | Document processor | |
CN102339291B (en) | Method and equipment for generating list | |
CN102207872A (en) | Method and system for customizing Web UI (User Interface) control according to user requirements | |
CN103092612A (en) | Method and electronic device for achieving three dimensional (3D) desktop mapping of Android operating system | |
CN102915297A (en) | Underlying grid structure and animation of tables | |
CN112015509A (en) | Data visualization large screen construction method, electronic device and storage medium | |
CN105393246A (en) | Selecting and editing visual elements with attribute groups | |
CN110516186A (en) | Page skeleton automatic generating method, equipment, storage medium and device | |
CN106407172B (en) | A kind of report form generation method based on XML | |
CN104699468B (en) | A kind of interface creating method of client and the client | |
CN1252561A (en) | Data processing | |
CN107092413A (en) | A kind of visible controls corners processing method and system | |
JP6068758B2 (en) | Programmable display | |
CN114153442A (en) | Large-screen visualization page configuration method and system based on visualization component | |
CN105426076A (en) | Information processing method and electronic equipment | |
EP3301651B1 (en) | In-editor spritesheeting | |
CN107832092A (en) | Suitable for the software platform and processing method of individual demand | |
KR101934369B1 (en) | System and method for providing contents using automatically margin creation | |
JP2013196708A (en) | Development device for controller program and creation method | |
US20150193976A1 (en) | Systems and methods of updating graphical objects | |
CN109800039A (en) | A kind of user interface presentation method, apparatus, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171107 |
|
RJ01 | Rejection of invention patent application after publication |