CN114281222A - iOS-based multi-view level management method, system and construction method - Google Patents

iOS-based multi-view level management method, system and construction method Download PDF

Info

Publication number
CN114281222A
CN114281222A CN202111535539.3A CN202111535539A CN114281222A CN 114281222 A CN114281222 A CN 114281222A CN 202111535539 A CN202111535539 A CN 202111535539A CN 114281222 A CN114281222 A CN 114281222A
Authority
CN
China
Prior art keywords
tableview
rolling
view
scrollview
tablevew
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
Application number
CN202111535539.3A
Other languages
Chinese (zh)
Inventor
叶世昌
王志刚
唐进
段凌云
陈正超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guiyang Yuwan Technology Co ltd
Original Assignee
Guiyang Yuwan Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guiyang Yuwan Technology Co ltd filed Critical Guiyang Yuwan Technology Co ltd
Priority to CN202111535539.3A priority Critical patent/CN114281222A/en
Publication of CN114281222A publication Critical patent/CN114281222A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application provides a multi-view level management method, a system and a construction method based on iOS, which comprises the following steps: monitoring a scrollView rolling agent, and acquiring the rolling positions of a tableView _1 (a first view) and a tableView _2 (a second view), wherein the first view is used for performing longitudinal rolling, the scrollView is arranged on a cell of a data source of the first view and is used for performing transverse rolling, the scrollView is divided into n pages of rolling distances from left to right in the transverse direction, and the n second views are tiled on the scrollView and used for performing longitudinal rolling; when the rolling position reached after the first view is rolled upwards exceeds the longitudinal height of the headerView, closing the rollable state of the first view and opening the rollable state of the second view; after the scrolling position of any one of the currently controlled second views reaches the top, the scrollable state of the second view is closed, and the scrollable state of the first view is opened.

Description

iOS-based multi-view level management method, system and construction method
Technical Field
The application relates to the technical field of data processing, in particular to a multi-view level management method, a multi-view level management system and a multi-view level construction method based on iOS.
Background
In the development work of the iOS client, for some complex pages, more elements are overlapped together and can be displayed only by sliding, a plurality of pages are overlapped together, the top can only move up and down, when the bottom simultaneously has transverse rolling and longitudinal rolling, a plurality of nested views are needed for realization, the problems of gesture conflict and element multiplexing are difficult to avoid, and a set of reasonable solution needs to be provided.
In the traditional multi-element display, a plurality of views need to be multiplexed and added to a page, so that the memory consumption is increased, and the difficulty of code management is improved. Therefore, for an abnormally complex page, it is difficult to implement the management mode (it is impossible to handle the situation that too many elements are alternated with each other), and the traditional solution is to add a View to a scrollView, which is an effect, but it is difficult to apply the method to a scene with many elements needing multiplexing, because View cannot do such management, and consumes too much memory, increases the amount of code unnecessarily, and the code maintenance is difficult.
Disclosure of Invention
The embodiment of the application aims to provide a multi-view level management method, a multi-view level management system and a multi-view level construction method based on iOS, and the problem of gesture conflict when horizontal rolling and multi-level longitudinal rolling exist in a page at the same time is cooperatively solved through multi-level tableView and scrollView.
In order to achieve the above object, embodiments of the present application are implemented as follows:
in a first aspect, an embodiment of the present application provides an iOS-based multi-view hierarchy management method, including: monitoring a scrollView rolling agent, and acquiring the rolling positions of a tablevView _1 and a tablevew _2, wherein the tablevView _1 is positioned at the bottom layer of a view controller, the frame of the tablevView _1 is a full screen and is used for performing longitudinal rolling, a header is arranged at the head of the tablevView _1, the size of the scrollView is consistent with the size of a cell arranged by a data source of the tablevView _1 and is arranged on the cell and is used for performing transverse rolling, a contentsize of the scrollView rolling is fixed in the longitudinal direction, n page rolling distances are divided left and right in the transverse direction, n tablevew _2 are tiled on the scrollView, each tablevew _2 occupies a page rolling distance, and each tablevew _2 is used for performing longitudinal rolling; when the reached rolling position after the tableView _1 rolls upwards exceeds the longitudinal height of the headView, closing the scrollable state of the tableView _1 and opening the scrollable state of each tableView _ 2; after the scrolling position of any tablevew _2 currently controlled reaches the top, the scrollable state of each tablevew _2 is closed, and the scrollable state of tablevew _1 is opened.
In the embodiment of the application, the scroll positions of tablevview _1 and tablevew _2 are obtained by monitoring a scrollView scroll agent, when the scroll position reached after tablevview _1 is scrolled upwards exceeds the longitudinal height of the headview (set at the group head of tablevview _1), the scrollable state (longitudinal scrolling) of the tablevview _1 is closed, and the scrollable state (longitudinal scrolling) of each tablevew _2 is opened; after the scrolling position of any tablevew _2 currently controlled reaches the top, the scrollable state of each tablevew _2 is closed, and the scrollable state of tablevew _1 is opened. Therefore, when the view slides up and down, the tablevew at the bottom (namely tablevew _1) is combined with the tablevew at the top (namely tablevew _2), and the scroll gesture is monitored by using the scrollview proxy, so that the gesture conflict can be effectively avoided, and the up-and-down linkage (the linkage of the tablevew at the bottom and the tablevew at the top) is realized. When the view slides left and right, the paging effect set by the scrollview can divide the pages by a plurality of tableview at the bottom, so that the pages can be switched by sliding left and right, and the complex page design effect is realized. Moreover, the tableView is adopted, so that the practicability is high; the page is switched in a transverse rolling mode by utilizing the paging attribute of the ScrollView, the offset does not need to be calculated, and the method is very efficient and convenient; through linkage of the two tableViews, the on and off of the scrollable state is set by utilizing the offset, the problem of gesture conflict when multilayer longitudinal scrolling (longitudinal scrolling of different layered views) simultaneously exists can be effectively solved, and the self-contained headerView of the tableView _1 is utilized to realize up-and-down scrolling without specially calculating the linkage of the headerView, so that the method is very simple and efficient.
With reference to the first aspect, in a first possible implementation manner of the first aspect, contentsize of the scrollView scroll is divided into 4 pages left and right in the horizontal direction, and correspondingly, the number of tableview _2 is 4.
With reference to the first aspect, in a second possible implementation manner of the first aspect, the method further includes: acquiring the position of a finger drop point touch View of a user; when the position of the finger landing point touch View is located in the mapping area corresponding to the tableView _1, the scrollable state of the tableView _1 is opened, and the scrollable state of each tableView _2 is closed; and when the position of the finger touch View is located in the mapping area corresponding to the tableView _2, opening the scrollable state of each tableView _2 and closing the scrollable state of tableView _ 1.
In the implementation mode, the position of the View is touched by acquiring a finger drop point of a user; when the position of the finger landing point touch View is located in the mapping area corresponding to the tableView _1, the scrollable state of the tableView _1 is opened, and the scrollable state of each tableView _2 is closed; when the position of the finger landing point touch View is located in the mapping area corresponding to the tableView _2, the scrollable state of each tableView _2 is opened, and the scrollable state of the tableView _1 is closed, so that the method can be matched with a mode of realizing switching of the scrollable states by monitoring the scrolling positions of the tableView _1 and the tableView _2, the operation intention of a user is effectively identified, and the improvement of user experience is facilitated.
In a second aspect, an embodiment of the present application provides a method for constructing an iOS-based multi-view hierarchical management system, including: adding a tableView _1 at the bottom layer of a View controller, and adding a View at the head of the tableView _1, wherein the frame of the tableView _1 is a full screen and is used for longitudinal scrolling, and a data source of the tableView _1 is provided with a cell; adding a scrollView with the same size on the cell for transverse rolling, wherein contentsize rolled by the scrollView is divided into n pages of rolling distance in the transverse left and right direction and does not move vertically; adding n tableview _2 on the scrollView, and spreading the tableview _2 on the scrollView, wherein each tableview _2 occupies a page rolling distance of the scrollView, and each tableview _2 is used for performing longitudinal rolling.
In the embodiment of the application, by constructing the multi-view hierarchical management system based on the iOS in this way, when the view slides up and down, the tablevew (namely tablevew _1) at the bottom is combined with the tablevew (namely tablevew _2) at the top, and the scroll gesture is monitored by using the scrollview agent, so that the gesture conflict can be effectively avoided, and the up-and-down linkage (the linkage of the tablevew at the bottom and the tablevew at the top) is realized. When the view slides left and right, the pages can be divided by a plurality of tableview at the bottom by utilizing the paging effect set by the scrollview, so that the pages can be switched by sliding left and right, and the complex page design effect is realized. Moreover, the tableView is adopted, so that the practicability is high; the page is switched in a transverse rolling mode by utilizing the paging attribute of the ScrollView, the offset does not need to be calculated, and the method is very efficient and convenient; through linkage of the two tableViews, the on and off of the scrollable state is set by utilizing the offset, the problem of gesture conflict when multilayer longitudinal scrolling (longitudinal scrolling of different layered views) simultaneously exists can be effectively solved, and the self-contained headerView of the tableView _1 is utilized to realize up-and-down scrolling without specially calculating the linkage of the headerView, so that the method is very simple and efficient.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the contentsize of the scrollView scroll is divided into 4 pages left and right in the horizontal direction, and correspondingly, the number of tableview _2 is 4.
With reference to the second aspect, in a second possible implementation manner of the second aspect, the method further includes: inheriting the UIGesturrecognizer to realize a locationInView method and a locationOfTouch method, and the method is used for acquiring the position of the finger drop point of the user touching the View; establishing a mapping area corresponding to the tableView _1 based on the touch event type of the tableView _1, and establishing a mapping area corresponding to the tableView _2 based on the touch event type of each tableView _ 2.
In the implementation mode, the UIGesturrecognizer is inherited to realize a locationInView method and a locationOfTouch method, so that the position of the finger of the user touching the View can be effectively obtained. And the establishment of the mapping area corresponding to the tableView _1 and the mapping area corresponding to each tableView _2 is beneficial to the mutual cooperation with the mode of realizing the switching of the scrollable state by monitoring the scrolling positions of the tableView _1 and the tableView _2, the operation intention of the user is effectively identified, and the user experience is improved.
In a third aspect, an embodiment of the present application provides an iOS-based multi-view hierarchical management system, including: the device comprises a rolling position monitoring unit, a view controller and a view controller, wherein the rolling position monitoring unit is used for monitoring a scrollView rolling agent and acquiring the rolling positions of a tablevview _1 and a tablevew _2, the tablevview _1 is positioned at the bottom layer of the view controller, the frame of the tablevview _1 is a full screen and is used for performing longitudinal rolling, the head of the tablevview _1 is provided with a headview, the size of the scrollView is consistent with the size of a cell set by a data source of the tablevview _1 and is arranged on the cell and used for performing transverse rolling, a contentsize of the scrollView rolling is fixed in the longitudinal direction, n page rolling distances are divided in the transverse direction, n tablevew _2 are horizontally laid on the scrollView, each tablevew _2 occupies one page rolling distance, and each tablevew _2 is used for performing longitudinal rolling; the rolling state control unit is used for closing the rollable state of the tableView _1 and opening the rollable state of each tableView _2 when the reached rolling position after the tableView _1 is rolled upwards exceeds the longitudinal height of the headView; the rolling state control unit is further configured to close the scrollable state of each tableView _2 and open the scrollable state of tableView _1 after the scrolling position of any currently controlled tableView _2 reaches the top.
In a fourth aspect, an embodiment of the present application provides a storage medium, where the storage medium includes a stored program, where, when the program runs, a device in which the storage medium is located is controlled to execute the iOS-based multi-view hierarchy management method according to any one of the first aspect and possible implementation manners of the first aspect, or execute the iOS-based multi-view hierarchy management system building method according to any one of the second aspect and possible implementation manners of the second aspect.
In a fifth aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, where the memory is configured to store information including program instructions, and the processor is configured to control execution of the program instructions, where the program instructions are loaded and executed by the processor to implement the iOS-based multi-view hierarchical management method according to any one of the first aspect or the possible implementation manners of the first aspect, or to implement the iOS-based multi-view hierarchical management system building method according to any one of the second aspect or the possible implementation manners of the second aspect.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other relevant drawings from these drawings without inventive effort.
Fig. 1 is a flowchart of a method for constructing an iOS-based multi-view hierarchical management system according to an embodiment of the present application.
FIG. 2 is a page layout level diagram of an iOS-based multi-view level management system.
Fig. 3 is a flowchart of an iOS-based multi-view hierarchical management method according to an embodiment of the present application.
Fig. 4 is a block diagram of a multi-view hierarchical management system based on iOS according to an embodiment of the present application.
Fig. 5 is a block diagram of an electronic device according to an embodiment of the present disclosure.
Icon: 10-iOS based multi-view hierarchical management system; 11-a scroll position listening unit; 12-a scroll state control unit; 20-an electronic device; 21-a memory; 22-a communication module; 23-a bus; 24-a processor.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
In order to solve the problem of gesture collision when horizontal scrolling and multi-level vertical scrolling exist in a page at the same time, the embodiment will first introduce a method for constructing a multi-view hierarchical management system based on iOS.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for constructing an iOS-based multi-view hierarchical management system according to an embodiment of the present application. In the present embodiment, the construction method of the multi-view hierarchy management system may be applied to an electronic device, including step S11, step S12, and step S13.
First, the electronic device may perform step S11.
Step S11: adding a tableView _1 at the bottom layer of the View controller, and adding a View at the head of the tableView _1, wherein the frame of the tableView _1 is full screen and is used for longitudinal scrolling, and a cell is arranged at the data source of the tableView _ 1.
In this embodiment, the electronic device may create a View controller (i.e., a View controller) in response to an operation of a developer, add a tableView _1 to a bottom layer of the View controller, where a frame (i.e., a frame) of the tableView _1 is full screen uiscreen. Thereafter, a cell may be set at the data source of tableView _ 1.
Then, the electronic apparatus may perform step S12.
Step S12: and adding a scrollView with the same size on the cell for transverse rolling, wherein contentsize of the scrollView is divided into n pages of rolling distance on the left and right in the transverse direction, and is fixed vertically.
In this embodiment, the electronic device may respond to an operation of a developer, add a scrollView having the same size as the cell on the cell, and perform a horizontal scroll, so that a contentsize of the scrollView scroll is fixed in a vertical direction, and n pages of scroll distances can be divided in a horizontal direction and in a left-right direction, where the n pages of scroll distances can be adjusted according to a development requirement. For example, the scrolling distance is divided into 4 pages in the lateral direction, and the present invention is not limited thereto.
After the scrollView is added and set, the electronic device may perform step S13.
Step S13: adding n tableview _2 on the scrollView, and spreading the tableview _2 on the scrollView, wherein each tableview _2 occupies a page rolling distance of the scrollView, and each tableview _2 is used for performing longitudinal rolling.
In this embodiment, the electronic device may add n tableview _2 on the scrollView in response to an operation of the developer, and lay the n tableview _2 on the scrollView, where each tableview _2 occupies a page scrolling distance of the scrollView. Therefore, each tableview _2 can scroll longitudinally, and since the bottom is scrollview, the tablevew can also scroll transversely. Here, when the contentsize of the scrollView scroll is divided by 4 page scroll distances in the lateral direction, the number of tableview _2 is also 4.
In addition, the electronic device can inherit the UIGesturre recognizizer under the operation of a developer, realize a locationInView method and a locationOfTouch method, and is used for acquiring the position of the finger drop point touch View of the user.
Then, a mapping area corresponding to the tableView _1 may be established based on the touch event type of the tableView _1, and a mapping area corresponding to the tableView _2 may be established based on the touch event type of each tableView _ 2.
For example, the touch event types of the tableView _1 include an a type, a B type, and a C type, and the touch event types of the 4 tableView _2 are a D type, an E type, an F type, and a G type, respectively. Then, the mapping area corresponding to tableView _1 covers the areas where the type a, type B and type C touch events are triggered by the position where the user's finger drop point touches View, and the mapping area corresponding to tableView _2 covers the areas where the type D, type E, type F and type G touch events are triggered by the position where the user's finger drop point touches View (even the mapping area corresponding to each tableView _2 may be subdivided).
Based on the method, the multi-view hierarchical management system based on the iOS can be constructed. The page layout hierarchy of the constructed iOS-based multi-view hierarchical management system is shown in fig. 2.
Based on the iOS-based multi-view hierarchical management system, the electronic device can run the iOS-based multi-view hierarchical management method. Referring to fig. 3, fig. 3 is a flowchart of an iOS-based multi-view hierarchical management method according to an embodiment of the present application. In the present embodiment, the iOS-based multi-view hierarchy management method may include step S21, step S22, and step S23.
First, the electronic device may perform step S21.
Step S21: monitoring a scrollView rolling agent, and acquiring the rolling positions of a tabLEView _1 and a tabLEView _2, wherein the tabLEView _1 is positioned at the bottom layer of a view controller, the frame of the tabLEView _1 is a full screen and is used for performing longitudinal rolling, a headerView is arranged at the group head of the tabLEView _1, the size of the scrollView is consistent with the size of a cell arranged by a data source of the tabLEView _1 and is arranged on the cell and is used for performing transverse rolling, a contentszze for scrolling is fixed in the longitudinal direction, n pages of rolling distance are divided left and right in the transverse direction, n tabLEView _2 are tiled on the scrollView, each tabLEView _2 occupies a page of rolling distance, and each tabLEVIEW _2 is used for performing longitudinal rolling.
In this embodiment, in the iOS-based multi-view hierarchical management system, a tableView _1 is located at the bottom layer of a view controller, a frame of the tableView _1 is a full screen and is used for performing longitudinal scrolling, a headgroup of the tableView _1 is provided with a headreviview, a size of a scrollView is consistent with a size of a cell set by a data source of the tableView _1 and is arranged on the cell and is used for performing lateral scrolling, contentsize for scrolling of the scrollView is fixed in the longitudinal direction, n page scrolling distances are divided in the lateral direction and the left direction, n tableView _2 are laid on the scrollView, each tableView _2 occupies a page scrolling distance, and each tableView _2 is used for performing longitudinal scrolling.
Then, the electronic device may obtain the scrolling positions of tableView _1 and tableView _2 by using a listening scrollView scrolling agent based on the iOS-based multi-view hierarchical management system. Judging the monitored rolling position of tableView _1 or tableView _ 2:
if the scroll position of tablevew _1 is monitored, the electronic device can judge whether the scroll position reached after tablevew _1 scrolls upwards exceeds the longitudinal height of the headerView.
When the scroll position reached after the tableView _1 is scrolled upward exceeds the longitudinal height of the headreviview, step S22 is executed.
Step S22: and when the reached scrolling position after the tableView _1 is scrolled upwards exceeds the longitudinal height of the headView, closing the scrollable state of the tableView _1 and opening the scrollable state of each tableView _ 2.
In this embodiment, when the scrolling position reached after the tableView _1 scrolls upwards exceeds the longitudinal height of the headview (the headview scrolls along with the scrolling of the tableView _1), the headview is scrolled out of the screen visually from the user, and at this time, the scrollable state of the tableView _1 may be closed, and the scrollable state of each tableView _2 may be opened.
If it is monitored that the scrolling position of the tableView _2 is the currently controlled tableView _2 (that is, any one of the n tableviews _2 may be in a controlled state under the operation of the user), the electronic device may determine whether the scrolling position of the tableView _2 reaches the top.
When the scroll position of this tableView _2 (i.e., the currently controlled tableView _2) reaches the top, step S23 is performed.
Step S23: after the scrolling position of any tablevew _2 currently controlled reaches the top, the scrollable state of each tablevew _2 is closed, and the scrollable state of tablevew _1 is opened.
In this embodiment, after the scrolling position of the currently controlled tableView _2 reaches the top, the electronic device may close the scrollable state of each tableView _2 and open the scrollable state of tableView _ 1.
The method comprises the steps that a scrollView rolling agent is monitored, the rolling positions of a tableView _1 and a tableView _2 are obtained, when the rolling position reached after the tableView _1 rolls upwards exceeds the longitudinal height of a header (arranged at the group head of the tableView _1), the rollable state (longitudinal rolling) of the tableView _1 is closed, and the rollable state (longitudinal rolling) of each tableView _2 is opened; after the scrolling position of any tablevew _2 currently controlled reaches the top, the scrollable state of each tablevew _2 is closed, and the scrollable state of tablevew _1 is opened. Therefore, when the view slides up and down, the tablevew at the bottom (namely tablevew _1) is combined with the tablevew at the top (namely tablevew _2), and the scroll gesture is monitored by using the scrollview proxy, so that the gesture conflict can be effectively avoided, and the up-and-down linkage (the linkage of the tablevew at the bottom and the tablevew at the top) is realized. When the view slides left and right, the paging effect set by the scrollview can divide the pages by a plurality of tableview at the bottom, so that the pages can be switched by sliding left and right, and the complex page design effect is realized. Moreover, the tableView is adopted, so that the practicability is high; the page is switched in a transverse rolling mode by utilizing the paging attribute of the ScrollView, the offset does not need to be calculated, and the method is very efficient and convenient; through linkage of the two tableViews, the on and off of the scrollable state is set by utilizing the offset, the problem of gesture conflict when multilayer longitudinal scrolling (longitudinal scrolling of different layered views) simultaneously exists can be effectively solved, and the self-contained headerView of the tableView _1 is utilized to realize up-and-down scrolling without specially calculating the linkage of the headerView, so that the method is very simple and efficient.
In addition, in the constructed multi-View hierarchical management system based on the iOS, when the uigesturgerecognizers are inherited, a locationInView method and a locationofftouch method are realized, and a mapping area corresponding to tableView _1 and a mapping area corresponding to tableView _2 are established, the electronic device may further acquire a position where a finger drop point of the user touches View before executing step S21, and when the position where the finger drop point touches View is located in the mapping area corresponding to tableView _1, open a scrollable state of tableView _1, and close a scrollable state of each tableView _ 2; and when the position of the finger touch View is located in the mapping area corresponding to the tableView _2, opening the scrollable state of each tableView _2 and closing the scrollable state of tableView _ 1.
The method comprises the steps of obtaining the position of a user touching View through a finger drop point; when the position of the finger landing point touch View is located in the mapping area corresponding to the tableView _1, the scrollable state of the tableView _1 is opened, and the scrollable state of each tableView _2 is closed; when the position of the finger landing point touch View is located in the mapping area corresponding to the tableView _2, the scrollable state of each tableView _2 is opened, and the scrollable state of the tableView _1 is closed, so that the method can be matched with a mode of realizing switching of the scrollable states by monitoring the scrolling positions of the tableView _1 and the tableView _2, the operation intention of a user is effectively identified, and the improvement of user experience is facilitated.
Referring to fig. 4, fig. 4 is a block diagram illustrating a multi-view hierarchical management system 10 based on iOS according to an embodiment of the present application. In this embodiment, the iOS-based multi-view hierarchical management system 10 may include:
the scroll position monitoring unit 11 is configured to monitor a scrollView scroll agent, and acquire scroll positions of a tablevview _1 and a tablevew _2, where the tablevview _1 is located at a bottom layer of a view controller, a frame of the tablevview _1 is a full screen and is configured to perform longitudinal scrolling, a header view is arranged at a group head of the tablevview _1, a size of the scrollView is consistent with a size of a cell set by a data source of the tablevview _1 and is arranged on the cell and is configured to perform lateral scrolling, a contentsize of the scrollView scrolling is fixed in a longitudinal direction, n page scroll distances are divided between a left side and a right side in the transverse direction, n tablevew _2 are laid on the scrollView, each tablevew _2 occupies a page scroll distance, and each tablevew _2 is configured to perform longitudinal scrolling.
And a rolling state control unit 12, configured to close the scrollable state of the tableView _1 and open the scrollable state of each tableView _2 when the reached rolling position after the tableView _1 is scrolled upwards exceeds the longitudinal height of the headreviview.
The scroll state control unit 12 is further configured to close the scrollable state of each tableView _2 and open the scrollable state of tableView _1 after the scroll position of any currently controlled tableView _2 reaches the top.
In this embodiment, the iOS-based multi-View hierarchical management system may further include a finger touch position unit, configured to acquire a position where a finger drop point of a user touches View; when the position of the finger landing point touch View is located in the mapping area corresponding to the tableView _1, the scrollable state of the tableView _1 is opened, and the scrollable state of each tableView _2 is closed; and when the position of the finger touch View is located in the mapping area corresponding to the tableView _2, opening the scrollable state of each tableView _2 and closing the scrollable state of tableView _ 1.
Referring to fig. 5, fig. 5 is a block diagram of an electronic device 20 according to an embodiment of the present disclosure.
In this embodiment, the electronic device 20 may be a personal computer, a tablet computer, a smart phone, etc. with an iOS system, which is not limited herein. Of course, the building process of the iOS-based multi-view hierarchical management system can be applied to other devices, and is not limited herein.
Illustratively, the electronic device 20 may include: a communication module 22 connected to the outside world via a network, one or more processors 24 for executing program instructions, a bus 23, and a different form of memory 21, such as a disk, ROM, or RAM, or any combination thereof. And, the electronic device 20 also has a display screen (e.g., a touch screen) that can present the constructed trajectory animation. The memory 21, the communication module 22, and the processor 24 may be connected by a bus 23.
Illustratively, the memory 21 has stored therein a program. The processor 24 may call and execute the programs from the memory 21, so that the iOS-based multiview hierarchy management method or the construction method of the iOS-based multiview hierarchy management system can be implemented by executing the programs.
An embodiment of the present application provides a storage medium, where the storage medium includes a stored program, where, when the program runs, a device in which the storage medium is located is controlled to execute an iOS-based multi-view hierarchy management method in the embodiment, or execute a method for constructing an iOS-based multi-view hierarchy management system in the embodiment.
To sum up, the embodiment of the present application provides a multi-view hierarchical management method, system and construction method based on iOS, where a scrollView rolling agent is monitored to obtain the rolling positions of a tableView _1 and a tableView _2, when the rolling position reached after the tableView _1 is rolled upwards exceeds the longitudinal height of a headview (set at the group head of the tableView _1), the scrollable state (longitudinal scrolling) of the tableView _1 is closed, and the scrollable state (longitudinal scrolling) of each tableView _2 is opened; after the scrolling position of any tablevew _2 currently controlled reaches the top, the scrollable state of each tablevew _2 is closed, and the scrollable state of tablevew _1 is opened. Therefore, when the view slides up and down, the tablevew at the bottom (namely tablevew _1) is combined with the tablevew at the top (namely tablevew _2), and the scroll gesture is monitored by using the scrollview proxy, so that the gesture conflict can be effectively avoided, and the up-and-down linkage (the linkage of the tablevew at the bottom and the tablevew at the top) is realized. When the view slides left and right, the paging effect set by the scrollview can divide the pages by a plurality of tableview at the bottom, so that the pages can be switched by sliding left and right, and the complex page design effect is realized. Moreover, the tableView is adopted, so that the practicability is high; the page is switched in a transverse rolling mode by utilizing the paging attribute of the ScrollView, the offset does not need to be calculated, and the method is very efficient and convenient; through linkage of the two tableViews, the on and off of the scrollable state is set by utilizing the offset, the problem of gesture conflict when multilayer longitudinal scrolling (longitudinal scrolling of different layered views) simultaneously exists can be effectively solved, and the self-contained headerView of the tableView _1 is utilized to realize up-and-down scrolling without specially calculating the linkage of the headerView, so that the method is very simple and efficient.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and there may be other divisions in actual implementation, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (9)

1. An iOS-based multi-view hierarchical management method, comprising:
monitoring a scrollView rolling agent, and acquiring the rolling positions of a tablevView _1 and a tablevew _2, wherein the tablevView _1 is positioned at the bottom layer of a view controller, the frame of the tablevView _1 is a full screen and is used for performing longitudinal rolling, a header is arranged at the head of the tablevView _1, the size of the scrollView is consistent with the size of a cell arranged by a data source of the tablevView _1 and is arranged on the cell and is used for performing transverse rolling, a contentsize of the scrollView rolling is fixed in the longitudinal direction, n page rolling distances are divided left and right in the transverse direction, n tablevew _2 are tiled on the scrollView, each tablevew _2 occupies a page rolling distance, and each tablevew _2 is used for performing longitudinal rolling;
when the reached rolling position after the tableView _1 rolls upwards exceeds the longitudinal height of the headView, closing the scrollable state of the tableView _1 and opening the scrollable state of each tableView _ 2;
after the scrolling position of any tablevew _2 currently controlled reaches the top, the scrollable state of each tablevew _2 is closed, and the scrollable state of tablevew _1 is opened.
2. The iOS-based multiview hierarchy management method of claim 1, wherein contentsize for scrollView scrolling is divided into 4 pages left and right in a horizontal direction, and the number of tableview _2 is 4.
3. The iOS-based multiview hierarchy management method of claim 1, further comprising:
acquiring the position of a finger drop point touch View of a user;
when the position of the finger landing point touch View is located in the mapping area corresponding to the tableView _1, the scrollable state of the tableView _1 is opened, and the scrollable state of each tableView _2 is closed;
and when the position of the finger touch View is located in the mapping area corresponding to the tableView _2, opening the scrollable state of each tableView _2 and closing the scrollable state of tableView _ 1.
4. A construction method of a multi-view hierarchical management system based on iOS is characterized by comprising the following steps:
adding a tableView _1 at the bottom layer of a View controller, and adding a View at the head of the tableView _1, wherein the frame of the tableView _1 is a full screen and is used for longitudinal scrolling, and a data source of the tableView _1 is provided with a cell;
adding a scrollView with the same size on the cell for transverse rolling, wherein contentsize rolled by the scrollView is divided into n pages of rolling distance in the transverse left and right direction and does not move vertically;
adding n tableview _2 on the scrollView, and spreading the tableview _2 on the scrollView, wherein each tableview _2 occupies a page rolling distance of the scrollView, and each tableview _2 is used for performing longitudinal rolling.
5. The method of claim 4, wherein a contentsize of the scrollView scroll is divided into 4 pages in the horizontal direction, and the number of tableview _2 is 4.
6. The method of constructing an iOS based multi-view hierarchical management system according to claim 4, the method further comprising:
inheriting the UIGesturrecognizer to realize a locationInView method and a locationOfTouch method, and the method is used for acquiring the position of the finger drop point of the user touching the View;
establishing a mapping area corresponding to the tableView _1 based on the touch event type of the tableView _1, and establishing a mapping area corresponding to the tableView _2 based on the touch event type of each tableView _ 2.
7. An iOS-based multi-view hierarchical management system, comprising:
the device comprises a rolling position monitoring unit, a view controller and a view controller, wherein the rolling position monitoring unit is used for monitoring a scrollView rolling agent and acquiring the rolling positions of a tablevview _1 and a tablevew _2, the tablevview _1 is positioned at the bottom layer of the view controller, the frame of the tablevview _1 is a full screen and is used for performing longitudinal rolling, the head of the tablevview _1 is provided with a headview, the size of the scrollView is consistent with the size of a cell set by a data source of the tablevview _1 and is arranged on the cell and used for performing transverse rolling, a contentsize of the scrollView rolling is fixed in the longitudinal direction, n page rolling distances are divided in the transverse direction, n tablevew _2 are horizontally laid on the scrollView, each tablevew _2 occupies one page rolling distance, and each tablevew _2 is used for performing longitudinal rolling;
the rolling state control unit is used for closing the rollable state of the tableView _1 and opening the rollable state of each tableView _2 when the reached rolling position after the tableView _1 is rolled upwards exceeds the longitudinal height of the headView;
the rolling state control unit is further configured to close the scrollable state of each tableView _2 and open the scrollable state of tableView _1 after the scrolling position of any currently controlled tableView _2 reaches the top.
8. A storage medium, characterized in that the storage medium includes a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the iOS-based multi-view hierarchy management method according to any one of claims 1 to 3, or to execute the iOS-based multi-view hierarchy management system building method according to any one of claims 4 to 6.
9. An electronic device comprising a memory for storing information including program instructions and a processor for controlling execution of the program instructions, the program instructions being loaded and executed by the processor to implement the iOS based multiview hierarchy management method of any one of claims 1 to 3 or to implement the construction method of the iOS based multiview hierarchy management system of any one of claims 4 to 6.
CN202111535539.3A 2021-12-15 2021-12-15 iOS-based multi-view level management method, system and construction method Pending CN114281222A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111535539.3A CN114281222A (en) 2021-12-15 2021-12-15 iOS-based multi-view level management method, system and construction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111535539.3A CN114281222A (en) 2021-12-15 2021-12-15 iOS-based multi-view level management method, system and construction method

Publications (1)

Publication Number Publication Date
CN114281222A true CN114281222A (en) 2022-04-05

Family

ID=80872389

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111535539.3A Pending CN114281222A (en) 2021-12-15 2021-12-15 iOS-based multi-view level management method, system and construction method

Country Status (1)

Country Link
CN (1) CN114281222A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115396546A (en) * 2022-07-22 2022-11-25 上海万物新生环保科技集团有限公司 Conflict processing method and device for sliding event

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115396546A (en) * 2022-07-22 2022-11-25 上海万物新生环保科技集团有限公司 Conflict processing method and device for sliding event
CN115396546B (en) * 2022-07-22 2023-10-27 上海万物新生环保科技集团有限公司 Conflict processing method and device for sliding event

Similar Documents

Publication Publication Date Title
US9547525B1 (en) Drag toolbar to enter tab switching interface
CN103995660B (en) The method and device of touch screen browser switch window
CN102520845B (en) A kind of mobile terminal recalls the method and device at thumbnail interface
CN103376977B (en) The display packing of browser and display device
CA2922060C (en) Swipe toolbar to switch tabs
CN102301331B (en) Interacting method and device for electronic equipment
CN106775301A (en) The screenshot method and terminal device of a kind of terminal
DE202008000269U1 (en) Portable electronic device
CN103984497A (en) Navigating among activities in a computing device
CN103513874B (en) The method and device of presentation of information
CN104750405A (en) Split-screen displaying method and device
CN103488411A (en) Method and device for switching pages
CN110928475B (en) Page interaction method, device, equipment and storage medium of intelligent interaction panel
CN107402962A (en) Page display method and device
CN110221758B (en) Scroll bar control method and device, computer equipment and storage medium
CN103414829A (en) Method, device and terminal device for controlling screen contents
CN112148168B (en) Icon moving method and device and electronic equipment
CN113163050A (en) Session interface display method and device
CN103513871B (en) The method and apparatus of control mobile terminal
CN114281222A (en) iOS-based multi-view level management method, system and construction method
CN108196944A (en) Mobile terminal background application inspection method and device
CN105630595B (en) A kind of information processing method and electronic equipment
CN103869926A (en) Power saving method and electronic device
CN108334267A (en) A kind of cursor-moving method, system and terminal device
CN104267812B (en) A kind of information processing method and electronic equipment

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