A method and device for creating a pop-up view, a computer device and a storage medium

By creating parent view controllers and child view controllers, the problem of complex pop-up view hierarchy is solved, achieving independent management of view hierarchy and code separation of the MVC model, thus improving code maintainability and readability.

CN116185402BActive Publication Date: 2025-11-07CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211734414.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2025-11-07
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

In existing technologies, the pop-up view hierarchy is complex, with data logic and layer display encapsulated in a single view subclass, resulting in difficult code reading and high maintenance costs.

Method used

By creating parent view controllers and child view controllers to manage the view hierarchy and data logic respectively, the code separation of the MVC model is achieved, and the view hierarchy is managed independently.

Benefits of technology

It simplifies the view hierarchy, improves code maintainability and readability, and achieves separation of the view from the original page.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116185402B_ABST
    Figure CN116185402B_ABST
Patent Text Reader

Abstract

The application relates to a pop-up view creation method and device, computer equipment and a storage medium. The method comprises the following steps: creating a parent view controller, including a root view, wherein the root view has a first parameter, the first parameter is determined according to a background parameter of a target pop-up view; creating a first sub-view under the parent view controller, the first sub-view is located on an upper layer of the root view; creating a sub-view controller, the sub-view controller is inherited from the parent view controller and obtains a second sub-view under the sub-view controller; the sub-view controller further comprises a control, and the sub-view controller is configured to provide a processing method applied to the control. By using the method, the problem of pop-up view hierarchy complexity in the prior art can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of user interface development, and in particular to a pop-up view creation method and device, computer equipment and a storage medium. BACKGROUND

[0002] In user interface (UI) design, a new view often needs to be popped up on the basis of a previous interface, and the new view has a semi-transparent background so that the previous interface is still visible under the transparent layer. The current implementation method is generally to create a subclass of the View of the user interface, for example, view1, add a sub-view (such as a date selection list) to it, add a semi-transparent sub-view and place it at the bottom layer of view1, and then add view1 to the current window or the current view.

[0003] The above implementation method has a hierarchical complexity problem. view1 is the only container, and data logic and layer display are both located in view1, which is not conducive to code reading and later maintenance. SUMMARY

[0004] Therefore, a pop-up view creation method and device, computer equipment and a storage medium are provided to improve the hierarchical complexity problem of the pop-up view in the prior art.

[0005] In one aspect, a pop-up view creation method is provided, which includes:

[0006] creating a parent view controller, the parent view controller including a root view, the root view having a first parameter determined according to a background parameter of a target pop-up view;

[0007] creating at least one first sub-view under the parent view controller, the first sub-view being located at an upper layer of the root view, wherein the first sub-view has a second parameter determined according to a content box parameter of the target pop-up view;

[0008] creating a sub-view controller, the sub-view controller being inherited from the parent view controller and obtaining a second sub-view under the sub-view controller; the sub-view controller further including a control, and the sub-view controller being configured to provide a processing method applied to the control, the control being determined according to a target function of the target pop-up view and being located in a region of the second sub-view; and the sub-view controller being used to display the second sub-view as a pop-up view when a pop-up operation is obtained.

[0009] In one embodiment, after the first sub-view under the parent view controller is created, the method further includes:

[0010] The parent view controller is set to pop up in an overlay manner, and an animation parameter is cancelled; and the first sub-view pops up according to an animation parameter of the target pop-up view.

[0011] In one embodiment, after the first sub-view under the parent view controller is created, the method further comprises:

[0012] A response view is created and a response event is added to the response view, the response view comprising one or more transparent views of a clear color, the response view being arranged around the first sub-view or being located at a top layer of a view hierarchy of the parent view controller;

[0013] The response event comprises: in response to a gesture located on the response view, closing a view controller of the response view.

[0014] In one embodiment, when the number of the response views is only one, the response view is added to the top layer of the view hierarchy of the parent view controller, and a response event is set for the response view: judging whether the gesture falls in an area of the first sub-view, and if not, closing the view controller of the response view.

[0015] In one embodiment, the parent view controller is configured to provide a function interface for closing a self view, for being called after being inherited by the sub-view controller.

[0016] In one embodiment, the parent view controller is configured to provide a function interface for an animation effect, for being rewritten when the sub-view controller is created.

[0017] In another aspect, a device for creating a pop-up view is provided, comprising:

[0018] A parent view controller module is configured to create a parent view controller, the parent view controller comprising a root view, the root view having a first parameter determined according to a background parameter of a target pop-up view; and to create a first sub-view under the parent view controller, the first sub-view being located above the root view, wherein the first sub-view has a second parameter determined according to a content frame parameter of the target pop-up view.

[0019] A sub-view controller module is configured to create a sub-view controller, the sub-view controller being inherited from the parent view controller to obtain a second sub-view under the sub-view controller; the sub-view controller further comprising a control, and the sub-view controller being configured to provide a processing method applied to the control, the control being determined according to a target function of the target pop-up view and being located in an area of the second sub-view; and the sub-view controller being configured to display as a pop-up view when a pop-up operation is obtained.

[0020] In still another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method when executing the computer program.

[0021] Also provided is a computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the steps of the method.

[0022] The pop-up view creation method, device, computer device and storage medium described above, compared to encapsulating data logic and layers in a unique view subclass, achieve independent management of view hierarchy by creating a separate view controller, separate from the original page, simplifying and clarifying the view hierarchy of the application; by encapsulating data and logic in the view controller, code separation of the MVC (model-View-controller) model is achieved, improving maintainability. BRIEF DESCRIPTION OF DRAWINGS

[0023] Figure 1 A flowchart of the pop-up view creation method in one embodiment;

[0024] Figure 2 A schematic diagram of the parent view controller and the child view controller in one embodiment;

[0025] Figure 3 A block diagram of the structure of the pop-up view creation device in one embodiment;

[0026] Figure 4 An internal structure diagram of the computer device in one embodiment. DETAILED DESCRIPTION

[0027] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0028] UI design refers to the overall design of the man-machine interaction, operation logic and interface aesthetics of software, which is a necessary development step for application software. UI can realize information collection and feedback, input and output for an operating system such as an IOS system. The present application is described taking the IOS system as an example.

[0029] In the IOS system, the navigation bar, toolbar, tab bar, table, collection, image, map and custom view can be contained in the pop-up view (pop-up window), which is a temporary view appearing on top of other content on the screen when a control or area is clicked, and can be closed by clicking another part of the screen or the button on the pop-up window. The pop-up window should not usually occupy the entire screen so that the user can clearly see the important content on the previous window.

[0030] The existing implementation of the pop-up view is generally to create a new view UIView subclass, for example, named view1, add a sub-view (such as a date selection list) to it, add a semi-transparent sub-view and place it at the bottom of view1, and then add view1 to the current window.

[0031] However, because view1 is the only container, the data logic and layer display are encapsulated in view1, and a large amount of code is not easy to read, and the maintenance cost is high when the scheme changes.

[0032] In addition, the newly created view subclass view1 must be added to the current window or the current view, and there is a parent-child relationship with the current window or the current view, the hierarchy is complex, and it is easy to cause confusion of view references, for example, there is a View with a tag of 123 on the original interface, if there is also a View with a tag of 123 in view1, the program will get a random result when reading the View with a tag of 123 from the top view, which does not meet the expectations.

[0033] The pop-up view creation method provided by the application can be used for UI development of terminals with IOS system, and the terminal can be but is not limited to various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices.

[0034] In one embodiment, as shown in Figure 1 The method comprises the following steps:

[0035] Step 101, creating a parent view controller, the parent view controller comprising a root view, the root view having a first parameter, the first parameter being determined according to the background parameter of a target pop-up view, wherein the parent view controller is a subclass of the view controller UIViewController provided by the system.

[0036] It can be understood that the target pop-up view is a to-be-constructed view according to business requirements.

[0037] Exemplarily, the creating the parent view controller comprises newly creating a subclass of a UIViewController (view controller), for example, named as viewControllerP, setting a root view view of the viewControllerP according to background parameters of the to-be-constructed view, for example, color, transparency and the like, for example, setting a background color of the root view view as semi-transparent, and the color can be specified according to specific business requirements.

[0038] In step 102, at least one first sub-view under the parent view controller is created, and the first sub-view is located on an upper layer of the root view, wherein the first sub-view has a second parameter, and the second parameter is determined according to a content box parameter of the target pop-up view.

[0039] The first sub-view is added to the parent view controller as an area for displaying business requirement content, the first sub-view can be an opaque view, the color of the first sub-view is generally white, and the color can be determined according to specific requirements of the target pop-up view, and the content box parameter can further include a position and a size, so as to determine the position and the size of the first sub-view, for example, the first sub-view can be located at an upper, middle or lower position of the root view.

[0040] The parent view controller can be directly applied to pop up in response to an operation on a control on a previous interface, and related controls and content of business requirements can be configured in the opaque first sub-view of the parent view controller, and the parent view controller is configured to call a system method dissmiss (animated: completion) to close itself, so that the parent view controller can complete common view operations, including: popping up a new view, the background color of the new view can be semi-transparent black (or other color / transparency), the previous interface is visible under the transparent layer, the view content is an opaque color, and various controls (including but not limited to: buttons, input text boxes, table views, and all iOS controls that can be implemented) for displaying and interacting with the user are on the view. The user can interact to select corresponding data, and the view will close itself to make the previous interface reappear.

[0041] The parent view controller can implement default functions of the pop-up view, and to implement functions of business requirements, the application provides a pop-up view creation method, which further comprises:

[0042] In step 103, a sub-view controller is created, for example, Figure 2As shown, the sub-view controller inherits from the parent view controller and obtains a second sub-view under the sub-view controller; the sub-view controller further includes a control, and the sub-view controller is configured to provide a processing method applied to the control, the control is determined according to a target function of the target pop-up view and is located in the second sub-view area, on the other hand, a third sub-view can be added according to business requirements, and the space can be located in the third sub-view area; the sub-view controller is used to display as a pop-up view when obtaining a pop-up operation.

[0043] The creation of the sub-view control is also implemented by creating a subclass of UIViewController, the sub-view controller inherits the attributes of the parent view controller, the sub-view controller serves as a container for managing data and business logic, and encapsulates processing methods provided externally, such as a proxy or a callback block.

[0044] Exemplarily, in the sub-view controller, one or more subclasses of UIView are created, various controls for displaying and interacting with the user are drawn therein, the user can select / input corresponding data through interaction, and then the data is transmitted to the sub-view controller through the proxy or callback block language feature of iOS, and the business logic is processed by the sub-view controller.

[0045] In the creation method of the pop-up view provided in the application, the parent view controller serves as the basis for design and provides a default implementation, the sub-view controller inherits from the parent view controller and encapsulates the logic of business requirements on the basis thereof, thereby separating specific business scenarios from general functions; on the other hand, data and logic can be placed in the ViewController, and the custom view content is placed in the view, thereby greatly improving maintainability; on the other hand, the layers of the pop-up view are implemented by a separate view controller and are separated from the previous interface, thereby simplifying and clarifying the view hierarchy.

[0046] In one embodiment, a pop-up animation of business requirements can be added to the pop-up view, exemplarily, after the first sub-view under the parent view controller is created, the following steps are further included:

[0047] The parent view controller is set to present in a pop-up manner, its property modalPresentationStyle is set to.overFullScreen to achieve full-screen overlay, and the transition animation of the parent view controller is removed (in the present(:, animated:, completion:) method, set the parameter animated to false to remove the transition animation of the parent view controller) to meet the requirement of instant pop-up of the viewControllerv, and the opaque first sub-view is set to have the animation parameters of the target pop-up view to pop up or disappear in the animation mode required by the business, and the animation effects include but are not limited to fade-in / fade-out, fly-in from top / bottom / left / right, rotation fly-in, etc., and the specific implementation mode of the animation includes but is not limited to UIView class method animation, ImageView animation, PropertyAnimator animation, Core Animation animation, web page playing animation, transform, Lottie, etc.

[0048] The closing of the parent view controller can be realized by calling the system method dissmiss(animated:, completion:), and the disappearance animation of the viewControllerv is not set, that is, the parameter animated is set to false.

[0049] In an embodiment, the parent view controller can also be added with a default closing function by creating a response view.

[0050] For example, one or more transparent views of a clear color are created as response views, and user interaction gesture response events are added to them, including but not limited to clicking, sliding, rotating, etc., the response view responds to the gesture on the response view and closes the parent view controller; and the sub-view controller inherited from the parent view controller can be closed when the response view of the sub-view controller is operated by a gesture when it is popped up.

[0051] In an embodiment, when the number of response views is 1, it is added to the top layer of the view hierarchy of the viewControllerv, and the hitTest(:withEvent:) of the response view is rewritten, which is used to determine whether the user's click falls in the opaque sub-view, and returns nil if so, otherwise returns itself.

[0052] In the implementation of one embodiment, a plurality of response views can be created, added to the root view of the view controller P, and form a sibling relationship with the first sub-view, and make the response views surround the first sub-view, and add the same user interaction gesture response event to all the response views, so that the user can achieve the purpose of making the entire parent view disappear when operating any one of the click response views.

[0053] The parent view controller is configured to provide a closeFunction interface for closing itself, which is called after the child view controller inherits.

[0054] The parent view controller is configured to provide an animation effect function interface, which is rewritten when the child view controller is created, to achieve its own pop-up animation / animation disappearance effect.

[0055] It should be understood that, although Figures 1-2 The steps in the flowchart of the application are shown in sequence according to the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, Figures 1-2 At least part of the steps in the flowchart of the application can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be executed in rotation or alternation with other steps or sub-steps or stages of other steps.

[0056] In one embodiment, as Figure 3 shown, a pop-up view creation device is provided, comprising a parent view controller module and a child view controller module, wherein:

[0057] The parent view controller module is configured to create a parent view controller, the parent view controller comprising a root view, the root view having a first parameter determined according to a background parameter of a target pop-up view; and create a first sub-view under the parent view controller, the first sub-view being located on the upper layer of the root view, wherein the first sub-view has a second parameter determined according to a content frame parameter of the target pop-up view;

[0058] The sub-view controller module is configured to create a sub-view controller, the sub-view controller inherits from the parent view controller to obtain a second sub-view under the sub-view controller, the sub-view controller further comprises a control, and the sub-view controller is configured to provide a processing method applied to the control, the control is determined according to a target function of the target pop-up view and located in the second sub-view area, in addition, a third sub-view can be created according to the target pop-up view, and the control can be located in the third sub-view area; and the sub-view controller is configured to display the pop-up view when the pop-up operation is obtained.

[0059] The pop-up view creation device provided in the application can realize independent management of the view hierarchy, separate from the original page, simplify and clarify the view hierarchy of the application by creating a separate view controller, and separate the code of the MVC (model-View-controller) model by encapsulating the data and logic in the view controller, thereby improving the maintainability.

[0060] In one embodiment, the parent view controller is set to be popped up in a covering manner and the animation parameter is cancelled; and the first sub-view is popped up according to the animation parameter of the target pop-up view, and the sub-view controller can realize the pop-up effect of the business requirement after the sub-view controller inherits.

[0061] In one embodiment, the parent view controller module creates a response view under the parent view controller and adds a response event to the response view according to the business requirement, for example, adds one or more transparent views with a color of clear as the response view and adds a user interaction gesture to the response view, the response view is used to respond to the gesture operation to close itself and make the parent view controller disappear; and the sub-view controller can respond to the gesture located in the response view to close itself after the sub-view controller inherits and is popped up.

[0062] When only one response view, for example, a click response view, is added, the response view is added to the uppermost layer of the view hierarchy of the view controller P, the hitTest(:withEvent:) of the response view is rewritten, and it is judged in the function that nil is returned when the operation of the user falls in the opaque sub-view, and otherwise, the response view itself is returned.

[0063] When multiple click response views are added, the multiple response views are added to the root view of the view controller P and form a sibling relationship with the opaque sub-view, on the layout, they surround the opaque sub-view, and the same user interaction gesture response event is added to all the click response views.

[0064] In one embodiment, the viewControllerP provides an interface: a closeFunction for the child view controller to call, and the child view controller can also override the function to achieve the purpose of realizing its own closing animation effect; on the other hand, the viewControllerP provides an interface: a plurality of animation effect functions for the child view controller to override, so as to achieve the purpose of realizing its own pop-up animation / animation disappearance effect.

[0065] The specific limitation of the pop-up view creation device can refer to the limitation of the pop-up view creation method in the foregoing, which will not be described here. Each module in the pop-up view creation device described above can be realized by software, hardware and a combination thereof in whole or in part. The above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to each of the above modules.

[0066] In one embodiment, a computer device is provided, which can be a terminal, and its internal structure diagram can be as shown in Figure 4 The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The network interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement a pop-up view creation method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.

[0067] Those skilled in the art can understand that Figure 4 The structure shown in the foregoing

[0068] In one embodiment, a computer device is provided, which includes a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the following steps when executing the computer program:

[0069] Step A, creating a parent view controller, which includes a root view with a first parameter determined according to a background parameter of a target pop-up view;

[0070] Step B, creating a first sub-view under the parent view controller, which is located on top of the root view, wherein the first sub-view has a second parameter determined according to a content frame parameter of the target pop-up view;

[0071] Step C, creating a sub-view controller, which inherits from the parent view controller and obtains a second sub-view under the sub-view controller; the sub-view controller further includes a control, and the sub-view controller is configured to provide a processing method applied to the control, which is determined according to a target function of the target pop-up view and is located in the second sub-view area; the sub-view controller is used to display as a pop-up view when a pop-up operation is obtained.

[0072] In one embodiment, the processor executing the computer program further implements the following steps:

[0073] The parent view controller is set to pop up in an overlay manner and cancel an animation parameter; and the first sub-view is popped up according to an animation parameter of the target pop-up view.

[0074] In one embodiment, the processor executing the computer program further implements the following steps:

[0075] Creating a response view and adding a response event to the response view, the response view including one or more transparent views with a clear color, the response view being arranged around the first sub-view or being located at a top layer of a view hierarchy of the parent view controller;

[0076] The response event includes: in response to a gesture located on the response view, closing a view controller of the response view.

[0077] In one embodiment, the processor executing the computer program further implements the following steps:

[0078] When the number of the response views is only one, adding the response view to a top layer of the view hierarchy of the parent view controller, and setting a response event for the response view: judging whether the gesture falls in an area of the first sub-view, and if not, closing itself.

[0079] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the following steps:

[0080] Step A, creating a parent view controller, the parent view controller including a root view, the root view having a first parameter determined according to a background parameter of a target pop-up view, wherein the parent view controller is a subclass of a previous page view controller;

[0081] Step B, creating a first child view under the parent view controller, the first child view being located on top of the root view, wherein the first child view has a second parameter determined according to a content frame parameter of the target pop-up view;

[0082] Step C, creating a child view controller, the child view controller inheriting from the parent view controller and obtaining a second child view under the child view controller; the child view controller further including a control, and the child view controller being configured to provide a processing method applied to the control, the control being determined according to a target function of the target pop-up view and being located in a region of the second child view; the child view controller being configured to display as a pop-up view when a pop-up operation is obtained.

[0083] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0084] The parent view controller is set to pop up in an overlay manner and cancel an animation parameter; and the first child view is popped up according to an animation parameter of the target pop-up view.

[0085] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0086] Creating a response view and adding a response event to the response view, the response view including one or more transparent views of a clear color, the response view being arranged around the first child view or being located at a top layer of a view hierarchy of the parent view controller;

[0087] The response event includes: in response to a gesture located on the response view, closing a self view controller.

[0088] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, databases, or other media in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0089] The technical features of the above embodiments can be combined in any way. In order to make the description simple, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.

[0090] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of the patent of the present application should be subject to the appended claims.

Claims

1. A method of creating a pop-up view, characterized by, The method comprises the following steps: creating a parent view controller for implementing the default function of a pop-up view, the parent view controller comprising a root view, the root view having a first parameter determined according to a background parameter of a target pop-up view; creating at least one first sub-view under the parent view controller, the first sub-view being located on the upper layer of the root view, wherein the first sub-view has a second parameter determined according to a content frame parameter of the target pop-up view; the parent view controller is configured to provide a function interface for closing itself, so as to be called after being inherited by a sub-view controller; the parent view controller is configured to provide an animation effect function interface, so as to be rewritten when the sub-view controller is created; creating the sub-view controller for implementing the function of business requirements, the sub-view controller inheriting the attribute of the parent view controller and obtaining a second sub-view under the sub-view controller; the sub-view controller further comprises a control, and the sub-view controller is configured to provide a processing method applied to the control, the control being determined according to the target function of the target pop-up view and being located in the second sub-view area; the sub-view controller is used to display as a pop-up view when a pop-up operation is obtained.

2. The method of claim 1, wherein, After the first sub-view under the parent view controller is created, the method further comprises the following steps: setting the parent view controller to pop up in an overlay manner and canceling the animation parameter; and the first sub-view is popped up according to the animation parameter of the target pop-up view.

3. The method of claim 1-2, wherein, After the first sub-view under the parent view controller is created, the method further comprises the following steps: creating a response view and adding a response event to the response view, the response view comprising one or more transparent views with a clear color, the response view being arranged around the first sub-view or being located at the top layer of the view hierarchy of the parent view controller; the response event comprises: closing the self-view controller in response to a gesture located on the response view.

4. The method of creating a pop-up view according to claim 3, wherein, When the number of the response views is only one, the response view is added to the top layer of the view hierarchy of the parent view controller, and a response event is set for the response view: judging whether the gesture falls in the area of the first sub-view, and if not, closing the self. 5.The method of creating a pop-up view of claim 1, wherein, After the sub-view controller is created, the method further comprises the following steps: creating a third sub-view according to the target pop-up view.

6. An apparatus for creating a pop-up view, characterized by The method comprises the following steps: a parent view controller module is used to create a parent view controller for implementing the default function of a pop-up view, the parent view controller comprising a root view, the root view having a first parameter determined according to a background parameter of a target pop-up view; the parent view controller module is further used to create at least one first sub-view under the parent view controller, the first sub-view being located on the upper layer of the root view, wherein the first sub-view has a second parameter determined according to a content frame parameter of the target pop-up view; the parent view controller is configured to provide a function interface for closing itself, so as to be called after being inherited by a sub-view controller; the parent view controller is configured to provide an animation effect function interface, so as to be rewritten when the sub-view controller is created. A sub-view controller module is configured to create the sub-view controller, the sub-view controller is configured to implement the function of the business requirement, the sub-view controller inherits the attribute of the parent view controller, and obtains a second sub-view under the sub-view controller; the sub-view controller further comprises a control, and the sub-view controller is configured to provide a processing method applied to the control, the control is determined according to the target function of the target pop-up view, and is located in the second sub-view area; the sub-view controller is configured to display as a pop-up view when the pop-up operation is acquired.

7. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Framework providing application programming interface for user interfaces and animation

    CN112136101A