CN116501205A - Method and device for moving covered view, electronic equipment and readable storage medium - Google Patents

Method and device for moving covered view, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN116501205A
CN116501205A CN202310478234.6A CN202310478234A CN116501205A CN 116501205 A CN116501205 A CN 116501205A CN 202310478234 A CN202310478234 A CN 202310478234A CN 116501205 A CN116501205 A CN 116501205A
Authority
CN
China
Prior art keywords
view
pop
display area
acquiring
overlaid
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.)
Granted
Application number
CN202310478234.6A
Other languages
Chinese (zh)
Other versions
CN116501205B (en
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.)
Chongqing Selis Phoenix Intelligent Innovation Technology Co ltd
Original Assignee
Chengdu Seres 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 Chengdu Seres Technology Co Ltd filed Critical Chengdu Seres Technology Co Ltd
Priority to CN202310478234.6A priority Critical patent/CN116501205B/en
Priority claimed from CN202310478234.6A external-priority patent/CN116501205B/en
Publication of CN116501205A publication Critical patent/CN116501205A/en
Application granted granted Critical
Publication of CN116501205B publication Critical patent/CN116501205B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range

Abstract

The application provides a moving method and device of an overlaid view, electronic equipment and a readable storage medium. The method comprises the following steps: when a view of the current page is popped up, pop-up view data obtained by monitoring the pop-up view is obtained; acquiring a pop-up view position, an overlaid view behind the pop-up view and movement indication data for indicating movement of the overlaid view according to the pop-up view data; acquiring a starting position of the designated display area and a relative position of the designated display area relative to the pop-up view according to the movement instruction data when the movement instruction data indicates that the covered view cannot be moved by a user; and acquiring a first position offset of the appointed display area according to the position of the pop-up view, the initial position and the relative position, and modifying the position attribute of the appointed display area in the self coordinate system according to the first position offset. The technical scheme of the method and the device can simply and efficiently solve the problem that the pop-up view covers the original view content.

Description

Method and device for moving covered view, electronic equipment and readable storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and apparatus for moving a covered view, an electronic device, and a readable storage medium.
Background
In the development of iOS mobile operating systems, the problem of popup views overlaying the original view content after a view popup may be encountered.
When the pop-up view covers the original view content, the whole layout of the original view can be in an instance of UISCROL View, after the view pops up, the existing offset of the instance of UISCROL View is stored, the needed offset is calculated, and then the related offset attribute is set as the needed offset. In addition, the whole layout of the original view can be added into a UITableView instance or a sub-instance thereof, and a hidden input box control is added. In addition, the frame (frame) attribute of a certain parent view can also be adjusted.
The above solutions have various drawbacks, such as large and complex workload, complex calculation process, narrow application range, and no practical effect of view movement, so that the solutions for the problem that the pop-up view covers the original view content are not simple and efficient.
Disclosure of Invention
In view of this, embodiments of the present application provide a method, an apparatus, an electronic device, and a computer readable storage medium for moving an overlaid view, so as to solve the problem that a pop-up view overlays original view content.
In a first aspect of an embodiment of the present application, there is provided a method for moving an overlaid view, including: when a view of the current page is popped up, pop-up view data obtained by monitoring the pop-up view is obtained; acquiring a pop-up view position, an overlaid view behind the pop-up view and movement indication data for indicating movement of the overlaid view according to the pop-up view data; acquiring a starting position of the designated display area and a relative position of the designated display area relative to the pop-up view according to the movement instruction data when the movement instruction data indicates that the covered view cannot be moved by a user; and acquiring a first position offset of the appointed display area according to the position of the pop-up view, the initial position and the relative position, and modifying the position attribute of the appointed display area in the self coordinate system according to the first position offset.
In a second aspect of embodiments of the present application, there is provided a mobile device for an overlaid view, the device comprising: the view data acquisition module is used for acquiring pop-up view data obtained by monitoring the pop-up view when the current page is popped up in a view manner; the indication data acquisition module is used for acquiring the pop-up view position, the covered view behind the pop-up view and movement indication data for indicating the covered view to move according to the pop-up view data; a position data acquisition module for acquiring a start position of the designated display area and a relative position of the designated display area relative to the pop-up view according to the movement instruction data when the movement instruction data indicates that the covered view cannot be moved by the user; the offset module is used for acquiring a first position offset of the appointed display area according to the pop-up view position, the initial position and the relative position, and modifying the position attribute of the appointed display area in the self coordinate system according to the first position offset.
In a third aspect of the embodiments of the present application, there is provided an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the above method when executing the computer program.
In a fourth aspect of the embodiments of the present application, there is provided a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the above method.
Compared with the prior art, the beneficial effects of the embodiment of the application at least comprise: according to the embodiment of the application, the first position offset is determined according to the designated display area and the relative position of the covered attempt, and the position attribute of the designated display area in the self coordinate system is modified according to the first position offset, so that the movement of the covered view is simply and efficiently realized.
Furthermore, the implementation method of the technical scheme of the embodiment of the application is simple in calculation, does not involve coordinate system conversion, and only needs to simply calculate a difference value or does not need to calculate; the functions are expanded, and the support of user interaction according to the service requirements is realized; the method can be suitable for various pop-up view coverage problems, has no limitation, and does not change the view hierarchy and structure of the existing page.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments or the description of the prior art, it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a method for moving an overlaid view according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a movement process of an overlaid view according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a mobile device with a covered view according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In the related art, when the pop-up view covers the original view content, the entire layout of the original view can be in an instance of uiscollolview (scroll view), after the view pops up, the existing offset of the uiscolview instance is stored, the required offset is calculated, then the related offset attribute is set as the required offset, and after the view disappears, the existing offsets of the attributes are restored. This approach may require a large number of view level transitions, is labor intensive and complex, and is prone to errors. Furthermore, conversion between a plurality of coordinate systems is involved, and the calculation process is complicated.
When the pop-up view covers the original view content, the whole layout of the original view can be further added with a hidden input frame control in a UITabaleView instance or a sub-instance thereof. On the system level, if an input box control is placed in a certain table of UITableView, after clicking the input box control, the keyboard pops up, and the TableView automatically shifts, so that the content of the table is displayed. The method has a narrow application range, only supports certain offsets when the UITableView is popped up by the keyboard, and only supports offset specified by the system and offset in the vertical direction.
The frame (frame) attribute of a certain parent view may also be adjusted when the pop-up view overlays the original view content. However, under automatic layout, the frames of a certain parent view may be refreshed, and then the frames may follow the rules of the automatic layout again, so that the views return to the original positions after shaking, and are not actually effective. Furthermore, adjusting the frame attribute involves a transformation between multiple coordinate systems, which is computationally complex.
When the pop-up view covers the original view content, the three schemes can be combined, the parent view is always searched upwards along the view level tree, the UiscrollView instance is adjusted when the UiscrollView instance exists, and the frame attribute of the root parent view is adjusted when the UiscrollView instance does not exist. In addition to the disadvantages of the three schemes, the method also has the advantages that because the frame of the root parent view is specified by the system, even if the program is temporarily adjusted, once the screen is turned or refreshed, the method can be restored, and the random adjustment of the parent view can cause the view to fail to meet the service requirement.
The above schemes have the common disadvantage that the offset is calculated and the flexibility is poor; and user interaction is not supported, and the situation that the user manually slides to where to display where does not occur.
In order to solve the above problems, the embodiments of the present application provide a movement scheme of a covered view, which simply and efficiently solves the problem that a pop-up view covers the original view content.
The movement scheme of the covered view in the embodiment of the application is implemented based on the origin attribute principle of the bounds of UIView of iOS. Wherein the origin of bounds is the origin of the view in its own coordinate system. One UIView has 2 coordinate systems: the coordinate system of the parent view and the coordinate system of itself. The own coordinate system is the "parent view coordinate system" of its child views. The coordinate system of a parent view of the UIView is represented by the frame attribute of the UIView class, the self coordinate system of the UIView is represented by the bounds attribute of the UIView class, and the value of the self center point of the UIView under the coordinate system of the parent view is represented by the center attribute of the UIView class. Wherein the center attribute describes the location of the center point of the current view in its parent view. frame and bounds are combined by center so that conversion between different coordinate systems is free.
The origin has two properties, x and y, which default to the upper left corner of the view. The origin may be assigned a value, such as (x: 10, y: 10), meaning: "the upper left corner of the view, once (0, 0), but now changed to (10, 10)", the sub-views will be shifted accordingly: move 10 to the left and move 10 upward. Meaning that if a uiniew's origin attribute is positively valued, its child view is shifted left/up based on the original position by the absolute value of the number; if a uiniew's origin attribute is given a negative value, its child view is shifted right/down based on its original position, the offset being the absolute value of the number.
The following is an explanation of nouns in the examples of the present application:
control: individual elements on the page, such as buttons, pictures, rectangular areas, etc.
View: a relatively independent block of controls.
Page: app (application) content of the whole screen is composed of views and controls.
Uikiew: the vast majority of controls and base classes of views. The control and view may be UIView or some subclass thereof.
The following describes in detail a moving method and apparatus of a covered view according to an embodiment of the present application with reference to the accompanying drawings.
Fig. 1 is a flow chart of a method for moving an overlaid view according to an embodiment of the present application. The method provided by the embodiment of the application can be executed by any electronic device with computer processing capability, such as a terminal or a server. As shown in fig. 1, the moving method of the covered view includes:
step S101, when the current page is popped up in a view mode, pop-up view data obtained by monitoring the pop-up view are obtained.
Step S102, acquiring a popup view position, an overlaid view behind the popup view and movement indication data for indicating movement of the overlaid view according to the popup view data.
Step S103, when the movement instruction data indicates that the covered view can not be moved by the user, acquiring the starting position of the designated display area and the relative position of the designated display area relative to the pop-up view according to the movement instruction data.
Step S104, obtaining a first position offset of the appointed display area according to the pop-up view position, the initial position and the relative position, and modifying the position attribute of the appointed display area in the self coordinate system according to the first position offset.
In the embodiment of the application, a device class of a mobile device of the covered view can be defined, and the device is introduced into the App item and can be used for realizing the mobile scheme of the covered view of the embodiment of the application. Specifically, the device class should be a single instance, with the same life cycle as the App, that is instantiated at the start of App. At the device initialization, 2 notifications, known as view pop-up and view retract, respectively, are listened to, which are predefined by itself. The method is concretely realized as follows: the device calls default attribute of system Notification center, and then calls addObserver (Any, selector: selector, name: NSNotification. Name. The first parameter of the method is transmitted to the device (self), the second parameter is transmitted to the device to define a function, the function is corresponding logic of the notification, the third parameter is the name of the notification to be monitored, and the fourth parameter can be transmitted to nil, which means that the monitored object, namely the sender of the notification, is not limited.
The device can store an example of the popup view, store whether the action of the view is popup or retrace, store an example of the rear view to be processed, store a designated display area on the example of the rear view to be processed, and generate a notification name of the popup view and a notification name of the retrace view.
Specifically, the view instance includes the instance itself as well as location information of the instance. Wherein the location information of the instance is a rectangle with a starting point (origin), a width and a height (size). An example of a rear view that needs to be processed is one that is overlaid with part of the content by the pop-up view, and this view business requirement requires that its content be somewhat slideable to resist the overlay. The display area is designated for determining the portion of the rear view that needs to be resistant to overlay. When the Notification Name of the view pop-up and the Notification Name of the view retraction are generated, a Name method of the Notification class of the iOS system can be called, a Notification Name string of the defined view pop-up is input, a Name method of the Notification class of the iOS system is called, and a Notification character string of the defined view retraction is input.
Notification and API (Application Programming Interface ) are two ways of device and external interaction. An external requestor, such as a page, can optionally interact with the device. Specifically, upon view pop-up/retraction, the outside may send a corresponding notification directly to the device. Upon view pop-up/retract, the external may call the device's API, recording the view pop-up/retract information.
In the embodiment of the present application, an API may be predefined to record view pop/retract information. The API is called by an external requestor at view pop-up. The API may record a pop-up view instance,
Example information such as whether to eject or retract is recorded, and position information of the ejected view is recorded.
In the embodiment of the application, an API may be further predefined to modify a system mechanism to obtain pop-up/retrieve information of a pop-up box in the form of present. The API is called upon App initialization, which may be invoked either externally or by an initialization function of the device. The API may utilize iOS method exchange techniques to implant one of the following two logics in the UIViewController class present (a) method. One of the logic is: and sending a view popup notice to the device, wherein rectangular area information including the position and the size of the popup view is attached to the notice. The second logic is: an API is called to obtain view pop-up/pop-up information, incoming pop-up view and pop-up view rectangular area information. The API may also embed one of the following two logics in the uiiewcontroller class discioss (a. Antiported:) method. One of the logic is: a view retraction notification is sent to the device, with rectangular region information including the position and size of the pop-up view attached to the notification. One of the logic is: an API is called to obtain view pop-up/pop-up information, incoming pop-up view and pop-up view rectangular area information.
In the embodiment of the application, an API may also be predefined to obtain the pop-up/retract information of the keyboard. The API may be called upon App initialization. It may be invoked either externally or by an initialization function of the device. Through the API, the device can listen to system notifications sent by the system upon keyboard pop-up/back.
In the embodiment of the present application, an API may be further predefined to accept an external "requirement" for performing displacement processing on the rear view covered by the pop-up view, which is hereinafter referred to as "requirement" API. The rear view is the overlaid view. The call timing of the API is one of the following call timings: calling time one: upon initialization of a page containing a pop-up view, the page is called. Calling time II: when the pop-up view is about to pop-up, it is invoked from outside, wherein these 2 cases can be invoked by the device, since the pop-up view of the system present mode and the timing of the keyboard view about to pop-up have been captured by the device package.
In the embodiment of the application, an API may be further predefined to perform restoration processing after the pop-up view is retracted. The calling time of the API is as follows: when the pop-up view is about to pop-up, it is invoked from outside, wherein these 2 cases can be invoked by the device, since the pop-up view of the system present mode and the timing of the keyboard view about to pop-up have been captured by the device package.
Since different views have different notification at pop-up, before step S101, the pop-up or retraction timing of any of the following pop-up views may be monitored: the middle part pops up the prompt box, pops up the keyboard, pops up the card at the bottom, and the self-defining pops up the view.
Specifically, for the middle popup prompt box, the iOS is realized by a system control UIAlertController on the concrete realization of the middle popup prompt box, and can also be realized by a self-defined uiiviewcontroller. Specifically, the present (or, an updated:) method of the uiiviewcontroller class of the iOS system may be invoked at the time of view pop-up. The uiiviewontroller class distss (a) method of the iOS system is called upon view reclamation. Therefore, the API of the timing capturing method capable of realizing the middle pop-up prompt box needs to modify a system mechanism to acquire pop-up/recovery information of the pop-up box in the form of present.
Specifically, for a pop-up keyboard, the iOS system will send two system notifications in succession when the keyboard pops up. The method comprises the following steps of: uiirespoonder.keyboard willshownotification and uiirespoonder.keyboard dieshownotification.
The uiiresponder, keyboard willshownotification is a notification when the keyboard is about to pop up but is not actually displayed on the interface, but is accompanied by information such as the position size of a rectangular area to be drawn by the keyboard. Uiiresponder.keyboard di shownotification is a notification when the keyboard has been ejected and displayed on the interface. When the keyboard is retracted, the system sends two system notifications in succession.
The two system notifications are respectively: uiiresponder.keyboard willhi deNotification and irisponder.keyboard di hideNotification.
The uir response, keyboard willHideNotification is a notification that the keyboard is about to disappear, and the irresponse, keyboard DidHideNotification is a notification that the keyboard is about to disappear.
Thus, the acquired view popup/recycle information API may monitor at either or both of the two system notifications irresponse.
When the keyboard is retracted, the view popup/recycle information acquisition API can monitor at any one of the UIR response device, the keyboard WillHideNotification and the IRresponse device, or monitor the two notifications together according to the service requirement.
Therefore, the API that can implement the timing acquisition method of ejecting the keyboard needs to acquire the ejection/retraction information of the keyboard.
Specifically, for bottom pop-up cards, the iOS system may be implemented by a system control UIAlertController, or may be implemented by a custom uiiiewcontroller. The difference between the capturing of the timing of popping up the keyboard and the capturing of the timing of popping up the prompt box in the middle part of the two system controls is the difference between the attribute settings such as the type setting, the animation setting, the position setting and the like of the class. Further, the bottom pop-up card may be a preview card implemented by the uiactigyviewcontroller class.
The three bottom views of the middle pop-up prompt box, the pop-up keyboard and the bottom pop-up card can call the present (closed) method of the UIIViewController class of the iOS system when the views are popped up. When the view is retracted, a method of disis (an updated) of the uiiviewController class of the iOS system is called, so that the method of capturing the opportunity is the same as the method of capturing the opportunity of popping up the prompt box in the middle, and the API of the method needs to modify a system mechanism to acquire the popping up/retracting information of the pop-up box in the form of present.
Specifically, for the custom pop-up view, since the pop-up and pop-up functions of the custom view are custom and the program is known, when a view pop-up notification is sent to the device or an API provided by the device is called in the pop-up functions, rectangular area information such as the position and the size of the pop-up view is attached to the notification, and the device records the rectangular area information of the pop-up view; when a view retraction notification is sent to the device or an API provided by the device is called in the retracted function, rectangular area information such as the position and the size of the pop-up view is attached to the notification, and the device records the rectangular area information of the pop-up view.
In this embodiment of the present application, when the device performs displacement processing on the rear view covered by the pop-up view, according to the service requirement, three parameters are transmitted to the "requirement" API from the outside, where the three parameters are respectively: the rear view instance that needs to be processed is the overlaid view, whether the user is required to freely move the rear view instance, and when the user cannot freely move the rear view instance, the display area and the position where the display area wants to be displayed are designated.
Specifically, on the page, not all the covered views need to be subjected to movement adjustment, so that selected portions in the covered views can form a designated display area.
Further, designating a display area may or may not allow the user to freely move. Therefore, it is necessary to determine whether the user is required to freely move the rear view instance, i.e., designate the display area. If the user is not free to move the rear view instance, a designated display area and the location where the display area is intended to be displayed may be specified according to business needs. If the user is free to move the rear view instance, the rear view instance may be free to slide or zoom in and out with a gesture interaction by the user to facilitate viewing the desired area. Further, a particular type of gesture may be specified as a swipe gesture, a zoom gesture, or a tap gesture, and is not limited thereto.
In the embodiment of the present application, if the user is not required to freely move the rear view instance, in step S103, the offset required by the origin of the bounds of the rear view instance may be calculated according to the designated display area and the position of the display area that are transmitted by the "required" API parameter. The position of the designated display area is the relative position of the designated display area relative to the pop-up view.
Specifically, the relative position is acquired, and the relative distance of the designated display area relative to the pop-up view can be acquired; the relative orientation of the designated display area with respect to the pop-up view may also be obtained; the center portion of the specified display area can also be acquired when the specified display area cannot be displayed completely.
In particular, the relative orientation includes specifying in which direction of the pop-up view the position of the display area is, e.g., above, below, left, right, obliquely above, and obliquely below. When the specified display region cannot be displayed completely, the center portion of the specified display region may be the center of the specified display region, or may be a position above the specified display region, or may be a position below the specified display region.
Taking a simple relative distance of the designated display area with respect to the pop-up view as an example, in step S104, a target position of the designated display area may be obtained according to the pop-up view position and the relative position; and acquiring a first position offset according to the initial position and the target position of the designated display area.
Specifically, as shown in FIG. 2, in page 201, the starting position of designated display area 202 is (x: 100, y: 500) and the size is (width: 100, height: 80).
The target position is diagonally upper with respect to the pop-up view 203, and a comparison is made with respect to their origin, specifying that the display area is spaced from the upper left corner of the pop-up view, i.e., the origin, by a distance of (x: -60, y: -180).
Since the pop-up view position and size have been stored by the device, the x-value and y-value of the position of the region of the pop-up view can be directly acquired.
Wherein, the obtaining of the x value can adopt one of the following two modes: the frame attribute of the region of the pop-up view is accessed, its origin attribute is accessed, and its x attribute is accessed, resulting in an x value of 40. The frame attribute of the region of the pop-up view is accessed, and its minX attribute is accessed, resulting in an x value of 40. Acquiring the y value may take one of two ways: the frame attribute of the region of the pop-up view is accessed, its origin attribute is accessed, and its y attribute is accessed, resulting in a y value of 200. The frame attribute of the region of the pop-up view is accessed, and its minY attribute is accessed, resulting in a y value of 200.
Further, the current position of the specified display area in the x direction may be calculated as: newx=x value of the region of the pop-up view+position of the display region relative to the pop-up box=40-60= -20; the current position of the designated display area in the y direction is calculated as follows: newy=y value of the region of the pop-up view+position of the display region relative to the pop-up box=200-180=20.
Finally, the calculated result of the offset of the appointed display area, namely the initial position of the appointed display area and the target position of the appointed display area is obtained as follows: in the X direction: x- =100- (-20) =120, y direction: y=500- (20) =480.
From the above calculation, the origin attribute of bounds of the rear view instance of the parameter may be set to the calculated offset (x: 120, y: 480).
In the embodiment of the application, when the movement indication data determines that the covered view can be moved by the user, a command gesture can be added to the covered view; when a command gesture operation of a user on the covered view is received to generate a command gesture signal, a second position offset is obtained according to the command gesture signal, and the position attribute of the appointed display area in the self coordinate system is modified according to the second position offset.
Specifically, gestures such as sliding, zooming and clicking can be added to the rear view example according to service requirements, so that a user is supported to freely view the rear view. Taking the example of creating a slide gesture, an initialization function of the uipan gesturerecognizer class may be invoked, and a gesture interaction processing function is entered. When a user slides, the system calls a gesture interaction processing function, so logic is written in the gesture interaction processing function.
When a command gesture operation is performed on the covered view by a user to generate a command gesture signal, a value of the command gesture signal can be obtained by calling a state attribute of the gesture, and the current state of the gesture is obtained. And if the point is the point of the current finger of the user, acquiring the point of the current finger of the user. The transfer function of the gesture is called, and the parameter requirement of this function is the view in which the gesture is located, so that the rear view instance is entered. The return value of the function is the increment of the gesture displacement, i.e., the second position offset.
After the delta is acquired, a setTransaction (in:) method is required to be invoked on the gesture, the first parameter is imported, zero, and the second parameter is imported into the rear view instance to destroy the delta.
When modifying the position attribute of the specified display area in its own coordinate system according to the second position offset, the second position offset may be set to the origin attribute of bounds of the rear view instance of the parameter.
In embodiments of the present application, the device may perceive the retraction of the view. Specifically, pop-up view retraction may be determined based on an external notification or pop-up or retraction information of the view recorded by the application program interface.
After step S104, in response to acquiring the retrieved view data obtained by monitoring the pop-up view, the position attribute of the specified display area in the own coordinate system is restored according to the start position. I.e. the origin attribute of bounds of the rear view instance of the parameter is set to the value of the starting position at view pop-up.
The technical scheme of the embodiment of the application designs a scheme implementation method for solving the problem of view coverage based on the iOS system. The implementation method is obviously different from the scheme in the prior art in terms of underlying logic, and specifically, the implementation method is simple to calculate, does not involve coordinate system conversion, and only needs to calculate a difference value simply or does not need to calculate; the functions are expanded, and the support of user interaction according to the service requirements is realized; the method can be suitable for various pop-up view coverage problems, has no limitation, and does not change the view hierarchy and structure of the existing page.
According to the moving method of the covered view, the moving of the covered view is simply and efficiently realized by determining the first position offset according to the designated display area and the relative position of the covered view and modifying the position attribute of the designated display area in the self coordinate system according to the first position offset.
The following are device embodiments of the present application, which may be used to perform method embodiments of the present application. The moving device of the covered view described below and the moving method of the covered view described above may be referred to correspondingly to each other. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
Fig. 3 is a schematic diagram of a mobile device with an overlay view according to an embodiment of the present application. As shown in fig. 3, a mobile device of an overlaid view in an embodiment of the present application includes:
the view data obtaining module 301 is configured to obtain pop-up view data obtained by monitoring the pop-up view when the current page has a view popped up.
An instruction data acquisition module 302, configured to acquire, according to the pop-up view data, a pop-up view position, an overlaid view behind the pop-up view, and movement instruction data that instructs the overlaid view to move.
And a position data acquisition module 303, configured to acquire, when the movement instruction data indicates that the covered view cannot be moved by the user, a start position of the specified display area and a relative position of the specified display area with respect to the pop-up view according to the movement instruction data.
The offset module 304 is configured to obtain a first position offset of the specified display area according to the pop-up view position, the start position, and the relative position, and modify a position attribute of the specified display area in the self coordinate system according to the first position offset.
In this embodiment of the present application, the offset module 304 is further configured to add a command gesture to the covered view when the movement indication data determines that the covered view can be moved by the user, and when receiving a command gesture signal generated by the user performing the command gesture operation on the covered view, obtain a second position offset according to the command gesture signal, and modify a position attribute of the specified display area in the self coordinate system according to the second position offset.
In this embodiment of the present application, the offset module 304 is further configured to restore, according to the starting position, the position attribute of the specified display area in the own coordinate system in response to obtaining the retrieved view data obtained by monitoring the pop-up view.
The mobile device of the covered view in the embodiment of the application may further include a determining module, configured to determine pop-up view retraction according to an external notification or pop-up or retraction information of the view recorded by the application program interface.
The position data obtaining module 303 may be further configured to obtain a relative distance of the specified display area with respect to the pop-up view, and obtain a relative orientation of the specified display area with respect to the pop-up view; and acquiring the central part of the designated display area when the designated display area cannot be completely displayed.
The view data acquisition module 301 is further configured to monitor ejection or retraction timing of any one of the following ejection views: the middle part pops up the prompt box, pops up the keyboard, pops up the card at the bottom, and the self-defining pops up the view.
The offset module 304 may be further configured to obtain a target position of the specified display area according to the pop-up view position and the relative position; and acquiring a first position offset according to the starting position and the target position of the designated display area.
Since each functional module of the covered view moving device in the exemplary embodiment of the present application corresponds to a step of the above-mentioned exemplary embodiment of the covered view moving method, for details not disclosed in the embodiment of the apparatus of the present application, please refer to the above-mentioned embodiment of the covered view moving method of the present application.
According to the mobile device of the covered view, the first position offset is determined according to the designated display area and the relative position of the covered view, and the position attribute of the designated display area in the coordinate system is modified according to the first position offset, so that the movement of the covered view is simply and efficiently realized.
Fig. 4 is a schematic diagram of an electronic device 4 provided in an embodiment of the present application. As shown in fig. 4, the electronic apparatus 4 of this embodiment includes: a processor 401, a memory 402 and a computer program 403 stored in the memory 402 and executable on the processor 401. The steps of the various method embodiments described above are implemented by processor 401 when executing computer program 403. Alternatively, the processor 401 may execute the computer program 403 to implement the functions of the modules in the above-described device embodiments.
The electronic device 4 may be a desktop computer, a notebook computer, a palm computer, a cloud server, or the like. The electronic device 4 may include, but is not limited to, a processor 401 and a memory 402. It will be appreciated by those skilled in the art that fig. 4 is merely an example of the electronic device 4 and is not limiting of the electronic device 4 and may include more or fewer components than shown, or different components.
The processor 401 may be a central processing unit (Central Processing Unit, CPU) or other general purpose processor, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like.
The memory 402 may be an internal storage unit of the electronic device 4, for example, a hard disk or a memory of the electronic device 4. The memory 402 may also be an external storage device of the electronic device 4, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the electronic device 4. Memory 402 may also include both internal storage units and external storage devices of electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit.
The integrated modules, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the flow in the methods of the above embodiments, or may be implemented by a computer program to instruct related hardware, and the computer program may be stored in a computer readable storage medium, where the computer program may implement the steps of the respective method embodiments described above when executed by a processor. The computer program may comprise computer program code, which may be in source code form, object code form, executable file or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium can be appropriately increased or decreased according to the requirements of the jurisdiction's jurisdiction and the patent practice, for example, in some jurisdictions, the computer readable medium does not include electrical carrier signals and telecommunication signals according to the jurisdiction and the patent practice.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. A method of moving an overlaid view, the method comprising:
when a view of the current page is popped up, pop-up view data obtained by monitoring the pop-up view is obtained;
acquiring a pop-up view position, an overlaid view behind the pop-up view and movement indication data for indicating movement of the overlaid view according to the pop-up view data;
acquiring a starting position of a designated display area and a relative position of the designated display area relative to the pop-up view according to the movement indication data when the movement indication data indicates that the covered view cannot be moved by a user;
and acquiring a first position offset of the appointed display area according to the pop-up view position, the initial position and the relative position, and modifying the position attribute of the appointed display area in a self coordinate system according to the first position offset.
2. The method of claim 1, wherein after acquiring a pop-up view position, an overlaid view behind the pop-up view, and movement indication data indicating movement of the overlaid view from the pop-up view data, the method further comprises:
adding a command gesture to the overlaid view when the movement indication data determines that the overlaid view is movable by a user;
when receiving command gesture operation of a user on the covered view to generate a command gesture signal, acquiring a second position offset according to the command gesture signal, and modifying the position attribute of the appointed display area in the self coordinate system according to the second position offset.
3. The method of claim 1, wherein after modifying the location attribute of the specified display area in its own coordinate system according to the first location offset, the method further comprises:
and responding to the acquired retracted view data obtained by monitoring the pop-up view, and restoring the position attribute of the appointed display area in the self coordinate system according to the initial position.
4. A method according to claim 3, wherein, in response to acquiring the retrieved view data from monitoring the pop-up view, the method further comprises:
and determining that the pop-up view is retracted according to an external notification or pop-up or retraction information of the view recorded by the application program interface.
5. The method according to claim 1, wherein acquiring a start position of a specified display area and a relative position of the specified display area with respect to the pop-up view based on the movement instruction data includes at least any one of:
acquiring the relative distance of the appointed display region relative to the pop-up view;
acquiring the relative orientation of the designated display area relative to the pop-up view; the method comprises the steps of,
and acquiring the central part of the designated display area when the designated display area cannot be completely displayed.
6. The method of claim 1, wherein prior to obtaining the pop-up view data from monitoring the pop-up view, the method further comprises:
monitoring the timing of the ejection or retraction of any of the following ejection views:
the middle part pops up the prompt box, pops up the keyboard, pops up the card at the bottom, and the self-defining pops up the view.
7. The method of claim 1, wherein obtaining the first position offset for the specified display area based on the pop-up view position, the start position, and the relative position comprises:
acquiring a target position of the designated display area according to the pop-up view position and the relative position;
and acquiring the first position offset according to the initial position of the designated display area and the target position.
8. A mobile device for an overlaid view, the device comprising:
the view data acquisition module is used for acquiring pop-up view data obtained by monitoring the pop-up view when the current page is popped up in a view manner;
the indication data acquisition module is used for acquiring a pop-up view position, an overlaid view behind the pop-up view and movement indication data for indicating the overlaid view to move according to the pop-up view data;
a position data acquisition module, configured to acquire, according to movement instruction data, a start position of a specified display area and a relative position of the specified display area with respect to the pop-up view when the movement instruction data indicates that the covered view cannot be moved by a user;
and the offset module is used for acquiring a first position offset of the appointed display area according to the pop-up view position, the starting position and the relative position, and modifying the position attribute of the appointed display area in the self coordinate system according to the first position offset.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 7.
CN202310478234.6A 2023-04-28 Method and device for moving covered view, electronic equipment and readable storage medium Active CN116501205B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310478234.6A CN116501205B (en) 2023-04-28 Method and device for moving covered view, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310478234.6A CN116501205B (en) 2023-04-28 Method and device for moving covered view, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN116501205A true CN116501205A (en) 2023-07-28
CN116501205B CN116501205B (en) 2024-04-26

Family

ID=

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1655664A2 (en) * 2004-10-06 2006-05-10 IBM Corporation System and method for managing a floating window
CN106814932A (en) * 2016-11-29 2017-06-09 深圳市金立通信设备有限公司 A kind of desktop wallpaper display methods and terminal
CN108829312A (en) * 2018-04-16 2018-11-16 北京五八信息技术有限公司 Pull down refreshing animation methods of exhibiting and device, electronic equipment and readable storage medium storing program for executing
CN111708959A (en) * 2020-06-16 2020-09-25 Oppo广东移动通信有限公司 Page display method and device, storage medium and electronic equipment
CN112988032A (en) * 2021-04-07 2021-06-18 北京字节跳动网络技术有限公司 Control display method and device and electronic equipment
CN113127125A (en) * 2021-04-22 2021-07-16 康键信息技术(深圳)有限公司 Page automatic adaptation method, device, equipment and storage medium
US20210274035A1 (en) * 2018-11-14 2021-09-02 Shenzhen Royole Technologies Co., Ltd. Method for anti-disturbing, electronic device, and computer-readable storage medium
CN114385065A (en) * 2021-12-20 2022-04-22 浪潮软件股份有限公司 iOS system based method and system for automatically preventing keyboard from being shielded by input source
CN114528517A (en) * 2022-02-08 2022-05-24 北京沃东天骏信息技术有限公司 View processing method and device, electronic equipment and computer readable medium
CN116521039A (en) * 2023-04-28 2023-08-01 成都赛力斯科技有限公司 Method and device for moving covered view, electronic equipment and readable storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1655664A2 (en) * 2004-10-06 2006-05-10 IBM Corporation System and method for managing a floating window
CN106814932A (en) * 2016-11-29 2017-06-09 深圳市金立通信设备有限公司 A kind of desktop wallpaper display methods and terminal
CN108829312A (en) * 2018-04-16 2018-11-16 北京五八信息技术有限公司 Pull down refreshing animation methods of exhibiting and device, electronic equipment and readable storage medium storing program for executing
US20210274035A1 (en) * 2018-11-14 2021-09-02 Shenzhen Royole Technologies Co., Ltd. Method for anti-disturbing, electronic device, and computer-readable storage medium
CN111708959A (en) * 2020-06-16 2020-09-25 Oppo广东移动通信有限公司 Page display method and device, storage medium and electronic equipment
CN112988032A (en) * 2021-04-07 2021-06-18 北京字节跳动网络技术有限公司 Control display method and device and electronic equipment
CN113127125A (en) * 2021-04-22 2021-07-16 康键信息技术(深圳)有限公司 Page automatic adaptation method, device, equipment and storage medium
CN114385065A (en) * 2021-12-20 2022-04-22 浪潮软件股份有限公司 iOS system based method and system for automatically preventing keyboard from being shielded by input source
CN114528517A (en) * 2022-02-08 2022-05-24 北京沃东天骏信息技术有限公司 View processing method and device, electronic equipment and computer readable medium
CN116521039A (en) * 2023-04-28 2023-08-01 成都赛力斯科技有限公司 Method and device for moving covered view, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
DK180685B1 (en) USER INTERFACES FOR RECEIVING AND HANDLING VISUAL MEDIA
EP3792738B1 (en) User interfaces for capturing and managing visual media
EP3070589B1 (en) Method and device for resizing selected region of previewing interface
KR102368385B1 (en) User interfaces for capturing and managing visual media
US9069445B2 (en) Electronic device with touch screen and page flipping method
CN109298909B (en) Window adjusting method, mobile terminal and computer readable storage medium
KR20130094054A (en) Apparatus and method for managing object in portable electronic device
EP3822758B1 (en) Method and apparatus for setting background of ui control
US20230370720A1 (en) Focusing method and apparatus, electronic device, and medium
US20230221846A1 (en) Desktop layout method and apparatus, and electronic device
CN112954193B (en) Shooting method, shooting device, electronic equipment and medium
CN111367434A (en) Touch delay detection method and device, electronic equipment and storage medium
CN109873980B (en) Video monitoring method and device and terminal equipment
CN111679772B (en) Screen recording method and system, multi-screen device and readable storage medium
CN111835972B (en) Shooting method and device and electronic equipment
CN116501205B (en) Method and device for moving covered view, electronic equipment and readable storage medium
CN116501205A (en) Method and device for moving covered view, electronic equipment and readable storage medium
CN113407290B (en) Application notification display method and device and electronic equipment
CN105635832A (en) Video processing method and device
CN112698771B (en) Display control method, device, electronic equipment and storage medium
KR20140127131A (en) Method for displaying image and an electronic device thereof
CN113393372A (en) Desktop wallpaper setting method and device
CN114302009A (en) Video processing method, video processing device, electronic equipment and medium
CN109085974B (en) Screen control method, system and terminal equipment
JP4179810B2 (en) Display data creation device, display data creation method, display data creation program, and computer-readable recording medium on which display data creation program is recorded

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240117

Address after: No. 13 Xingxiang Road, Zengjia Town, High tech Zone, Shapingba District, Chongqing, 400039

Applicant after: Chongqing Selis Phoenix Intelligent Innovation Technology Co.,Ltd.

Address before: 610095 No. 2901, floor 29, unit 1, building 1, No. 151, Tianfu Second Street, high tech Zone, China (Sichuan) pilot Free Trade Zone, Chengdu, Sichuan Province

Applicant before: Chengdu Thalys Technology Co.,Ltd.

GR01 Patent grant