Rounded view display method, apparatus, device, medium, and product
By setting both the parent and child views to rounded corners and compensating for the non-rounded corner areas of the child views, the off-screen rendering problem caused by the child views obscuring the rounded corners of the parent views is solved, thus improving display efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2022-01-24
- Publication Date
- 2026-06-19
AI Technical Summary
In iOS, when a child view occludes the rounded corners of its parent view, it increases off-screen rendering and reduces display efficiency.
Set both the parent and child views to rounded corners, and use compensation to handle the non-rounded corner areas of the child views to avoid off-screen rendering.
It improves the display efficiency of the view, avoids off-screen rendering, and ensures the normal display of subviews.
Smart Images

Figure CN116521286B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, device, medium, and product for displaying rounded corner views. Background Technology
[0002] A view can refer to the page displayed on the screen, while a parent view can refer to the view on which the current view is based. For example, if view B is displayed within view A, and view A is deleted, view B will also no longer be displayed. View A is the parent view of view B, and view B is the child view of view A. A rounded corner view refers to a view where the top left, top right, bottom left, and bottom right areas of the displayed interface are rounded, rather than the more common right-angled shapes. In iOS (iPhone Operating System), rounded corner views are usually set through initialization controls, typically using the view's corner radius parameter (layer.cornerRadius, view.cornerradius) to set the rounded corner effect of the parent view.
[0003] In related technologies, a subview layer typically exists on top of the view layer. If the parent view is a rounded corner view, the subview may obscure the rounded corners of the parent view. In this case, the MasksToBounds parameter needs to be used to cut off the portion of the subview that is obscuring the parent view's rounded corners. This cutting off of the subview's obscuring area ensures that a corner of the subview becomes rounded after cutting, thus ensuring that the parent view's rounded corners are displayed correctly. This cutting process triggers off-screen rendering, increasing the rendering overhead of the view and reducing display efficiency. Summary of the Invention
[0004] This disclosure provides a method, apparatus, device, medium, and product for displaying rounded corner views, to overcome the problem that the rounded corner display of subviews triggers off-screen rendering, resulting in low display efficiency.
[0005] In a first aspect, embodiments of this disclosure provide a method for displaying a rounded corner view, including:
[0006] Set both the parent view and the child view to be displayed as rounded corner views to obtain multiple first rounded corner areas of the child view and multiple second rounded corner areas of the parent view; the child view depends on the parent view when it is displayed.
[0007] For a target first rounded corner region in multiple first rounded corner regions, if it is determined that there is no second rounded corner region in multiple second rounded corner regions that overlaps with the target first rounded corner region, then the target first rounded corner region is displayed in a compensated manner.
[0008] In a second aspect, embodiments of this disclosure provide a rounded corner view display device, comprising:
[0009] The rounded corner setting unit is used to set both the parent view and the child view to be displayed as rounded corner views, obtaining multiple first rounded corner areas of the child view and multiple second rounded corner areas of the parent view; the child view depends on the parent view when it is displayed.
[0010] The first compensation unit is used to compensate and display the target first rounded corner area when it is determined that there is no second rounded corner area overlapping with the target first rounded corner area in the multiple first rounded corner areas.
[0011] Thirdly, embodiments of this disclosure provide an electronic device, including: a processor and a memory;
[0012] The memory stores the instructions that the computer executes;
[0013] The processor executes computer execution instructions stored in memory, causing the processor to perform the rounded corner view display method as described in the first aspect above and various possible designs of the first aspect.
[0014] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the rounded corner view display method described above and various possible designs of the first aspect.
[0015] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the rounded corner view display method described in the first aspect above and various possible designs of the first aspect.
[0016] The rounded corner view display method provided in this embodiment can set both the parent view and the child view to be displayed as rounded corner views, obtaining multiple first rounded corner areas of the child view and multiple second rounded corner areas of the parent view. In this case, all corners of the child view are rounded, and setting all corners of the child view as rounded corner views does not trigger off-screen rendering. Then, to ensure the normal display of the child view, for a target first rounded corner area among the multiple first rounded corner areas, if it is determined that there is no second rounded corner area overlapping with the target first rounded corner area among the multiple second rounded corner areas, the target first rounded corner area is compensated for. Compensating for the target first rounded corner area ensures the normal display of the child view, avoids triggering off-screen rendering, and improves the display efficiency of the view. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 An application network architecture diagram of the rounded corner view display method provided in this disclosure embodiment;
[0019] Figure 2 A flowchart illustrating one embodiment of a rounded corner view display method provided in this disclosure;
[0020] Figure 3 An example diagram of a rounded corner region in a parent view provided in an embodiment of this disclosure;
[0021] Figure 4 An example diagram of a similar rounded corner region provided for embodiments of this disclosure;
[0022] Figure 5 An example diagram of a display view provided in an embodiment of this disclosure;
[0023] Figure 6 A flowchart of yet another embodiment of a rounded corner view display method provided by this disclosure;
[0024] Figure 7 A structural example diagram of a rounded corner view display device provided in this disclosure embodiment;
[0025] Figure 8 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0027] The technical solution disclosed herein can be applied to view display scenarios where rounded corners are required. It sets both the parent view and the child view to rounded corners and compensates for the view areas that do not need to be rounded, so as to achieve normal display of the view, avoid triggering off-screen rendering, and improve the efficiency of rounded corner display of the view.
[0028] In related technologies, child views can typically exist on top of a parent view. When the parent view is set to rounded corners, the child view may obscure the rounded corner areas of the parent view. For example, when the parent view is set to rounded corners, the top left, top right, bottom left, and bottom right areas of the parent view are all rounded, which can be called the rounded corner areas of the view. Since the child view is displayed on top of the parent view, when both the parent and child views are displayed simultaneously, the child view may obscure the rounded corners of the parent view. For example, suppose the child view obscures the top left rounded corner area of the parent view. To solve the problem of child views obscuring the rounded corner areas of the parent view, the `masksToBounds` parameter can be used to cut off the portion of the rounded corners obscured by the child view. For example, if the child view obscures the top left rounded corner area of the parent view, the top left rounded corner area of the child view can be cut off. However, cutting the child view triggers off-screen rendering, increasing the rendering overhead of the view, reducing display efficiency, and causing frequent frame drops.
[0029] To address the aforementioned technical issues, this embodiment does not cut the subview; instead, it sets rounded corners on the subview as well, thus achieving rounded corner display. For areas within the subview that do not require rounded corners, compensation is applied. Furthermore, to avoid triggering off-screen rendering, a new display view can be generated for the areas within the subview that do not require rounded corners, thereby resolving the issue of the parent view's rounded corners displaying correctly.
[0030] In the embodiments of this disclosure, both the parent view and the child view to be displayed can be set as rounded corner views, obtaining multiple first rounded corner areas of the child view and multiple second rounded corner areas of the parent view. In this case, all corners of the child view are rounded, and setting all corners of the child view as rounded corner views does not trigger off-screen rendering. Subsequently, to ensure the normal display of the child view, for a target first rounded corner area among the multiple first rounded corner areas, if it is determined that there is no second rounded corner area overlapping with the target first rounded corner area among the multiple second rounded corner areas, the target first rounded corner area is compensated for. Compensating for the target first rounded corner area ensures the normal display of the child view, avoids triggering off-screen rendering, and improves the display efficiency of the view.
[0031] The technical solutions of this disclosure and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0032] Figure 1This is an application network architecture diagram of a rounded corner view-based display method according to embodiments of the present disclosure. The application network architecture according to embodiments of the present disclosure may include an electronic device and a client connected to the electronic device via a local area network (LAN) or a wide area network (WAN). It is assumed that the electronic device can be a personal computer, a regular server, a supercomputer, a cloud server, or other similar server; the specific type of electronic device is not limited in this disclosure. The client can be, for example, a mobile phone, tablet computer, personal computer, smart home appliance, wearable device, or other terminal device; the specific type of client is not limited in this disclosure. Figure 1 As shown, taking cloud server 1 as an electronic device and tablet computer 21 or laptop computer 22 as the first client 2, either first client 2 can provide cloud server 1 with the parent view and child view that the display screen needs to display. Cloud server 1 can implement the rounded corner display of the parent view based on the rounded corner view display method provided in this embodiment, that is, when displaying the parent view and child view, the first display view is displayed in the target first rounded corner area. After completing the view pages of the parent view, child view, and first display view, the view page can be obtained. At this time, when client 2 requests access to the view page from cloud server 1, it can obtain the view page after rounded corner settings and compensation display.
[0033] refer to Figure 2 , Figure 2 This flowchart illustrates one embodiment of a rounded corner view display method provided in this disclosure. The rounded corner view display method can be configured as a rounded corner view display device, which can be located in an electronic device. The rounded corner view display method may include the following steps:
[0034] S201: Set both the parent view and the child view to be displayed as rounded corner views, and obtain multiple first rounded corner areas of the child view and multiple second rounded corner areas of the parent view.
[0035] The parent view and child views can be the views to be displayed on the screen. Child views depend on the parent view when they are displayed, and child views can be displayed on top of the parent view.
[0036] In practical applications, the parent view and child views can be rectangular views. In some special scenarios, the parent view and child views can also be polygonal, such as circles, triangles, rhombuses, etc.
[0037] Parent and child views can be set to rounded corners using the same rounded corner setting method. When setting both parent and child views to rounded corners, the size of the rounded corners can be adjusted. Different rounded corner sizes result in different rounded corner areas for the views.
[0038] In one possible design, both the parent and child views can be set to rounded corners using the CALayer cornerRadius parameter. The view corner radius parameter can be any parameter used in related technologies to set the rounded corner attribute of a view. When the view corner radius parameter is set to any value, the view can be a view with a corner radius corresponding to that value. To ensure consistency in the rounded corner display between the parent and child views, the child view's view corner radius parameter can be the same as the parent view's view corner radius parameter.
[0039] When a subview is set to a rounded corner view, it can include four rounded corner areas, which are the top left, bottom left, top right, and bottom right rounded corner areas of the parent view.
[0040] When the parent view is set to a rounded corner view, and the parent view is a rectangle, the parent view can include four rounded corner areas, namely the top left, bottom left, top right, and bottom right rounded corner areas in the parent view.
[0041] Optionally, the rounded corner area can be the sector area containing the arc of the rounded corner. (See reference) Figure 3 The rounded corner parent view, in a set rounded corner parent view 300, can include four rounded corner areas, namely the upper left rounded corner area 301, the upper right rounded corner area 302, the lower left rounded corner area 303, and the lower right rounded corner area 304. Rounded corner areas 301 to 304 are all fan-shaped areas.
[0042] S202: For a target first rounded corner region in multiple first rounded corner regions, if it is determined that there is no second rounded corner region in multiple second rounded corner regions that overlaps with the target first rounded corner region, then the target first rounded corner region is displayed in a compensated manner.
[0043] The target first rounded corner region can be any one of multiple first rounded corner regions, that is, one of the multiple first rounded corner regions currently in the state of determining whether there is an overlap relationship with each of the second rounded corner regions. The target first rounded corner region and the second rounded corner region have an overlapping relationship, which can include the target first rounded corner region and the second rounded corner region having completely identical or partially identical areas.
[0044] For ease of understanding, please refer to Figure 4 Assuming Figure 3 It is a parent view, and also a Figure 3A subview 400 is added to the parent view 300. The subview 400 can include four rounded corner regions: a top-left rounded corner region 401, a top-right rounded corner region 402, a bottom-left rounded corner region 403, and a bottom-right rounded corner region 404. Rounded corner regions 401 to 404 are all fan-shaped regions. The top-left rounded corner region 301 of the parent view 300 and the top-left rounded corner region 401 of the subview are the same region; therefore, either the top-left rounded corner region 301 of the parent view 300 or the top-left rounded corner region 401 of the subview are overlapping rounded corner regions. The target first rounded corner region can be determined from the first rounded corner regions that are different from all the second rounded corner regions. Figure 4 The overlapping relationship shown is a complete overlap (full overlap). In practical applications, the overlapping relationship can also include partial regional overlap.
[0045] In the embodiments of this disclosure, both the parent view and the child view to be displayed can be set as rounded corner views, obtaining multiple first rounded corner areas of the child view and multiple second rounded corner areas of the parent view. In this case, all corners of the child view are rounded, and setting all corners of the child view as rounded corner views does not trigger off-screen rendering. Subsequently, to ensure the normal display of the child view, for a target first rounded corner area among the multiple first rounded corner areas, if it is determined that there is no second rounded corner area overlapping with the target first rounded corner area among the multiple second rounded corner areas, the target first rounded corner area is compensated for. Compensating for the target first rounded corner area ensures the normal display of the child view, avoids triggering off-screen rendering, and improves the display efficiency of the view.
[0046] As one embodiment, compensating for the first rounded corner area of the target by displaying it includes:
[0047] A first display view is generated based on the content displayed by the subview in the first rounded corner area of the target;
[0048] When displaying the parent view and child view, the first display view is displayed in the first rounded corner area of the target.
[0049] The compensation display can be based on the content displayed before it was set as a rounded corner view. Specifically, the content displayed in the first display view can be the same as the content displayed in the target first rounded corner area of the subview (i.e., the content displayed in the first display view can be the same as the content displayed in the target first rounded corner area of the subview when it was not set as a rounded corner view). During display, the display effect of the subview is made the same as the display effect when the subview was not set as a rounded corner view.
[0050] In one possible design, the view display area of the first display view can be the area of the subview before it is set as a rounded corner view. That is, the view display area of the first display view can be obtained by concatenating the area difference between the subview before and after the target first rounded corner area is set as a rounded corner view with the target first rounded corner area. For example... Figure 5 As shown, assuming Figure 4 The upper right rounded corner area 402, the lower left rounded corner area 403, and the lower right rounded corner area 404 (the right-angled side of the arc is covered by the black rectangle of the first display area, and the arc part is displayed normally) can all be the determined target first rounded corner areas. These rounded corner areas are all fan-shaped areas. Then, a matching first display view is generated for each target first rounded corner area. The view display area where each first display view is located can be a rectangular display area 501, a display rectangle 502, and a rectangular display area 503 (black rectangle).
[0051] The content displayed by the subview within the first rounded corner area of the target can include the subview's display color within that area. The displayed content may also include the subview's position data within the first rounded corner area of the target, such as the arc and the center of the arc.
[0052] In another possible design, the display area of the first display view can be a rectangular area capable of covering the target first rounded corner area and the area difference between the target first rounded corner area before the subview is set as a rounded corner view and the area of the target first rounded corner area after it is set as a rounded corner view. Assume... Figure 3 The upper right rounded corner region 302, lower left rounded corner region 303, and lower right rounded corner region 304 are all determined target first rounded corner regions. Therefore, a first display view is generated for each target first rounded corner region. Figure 5 The display areas 501-503 shown can all be... Figure 5 The rectangle shown.
[0053] The display area of any first display view can be calculated based on the regional position data of the target first rounded corner region. For example, the length and width of the rectangular region of the first display view can be calculated using the regional position data of the arc of the target first rounded corner region and the center of the corresponding arc, and the location point of the center of the rectangle can be determined. For example, when the arc is 90 degrees, the length and width of the rectangle can be determined by the lines connecting the two ends of the arc to the center. Of course, the length and width of a 90-degree arc are equal. The midpoint of the line segment formed by the lines connecting the two ends of the arc is determined as the display position point of the rectangular region, and the center point of the rectangular region coincides with this display position point.
[0054] When the first display view is displayed, the content displayed in the target first rounded corner area of the subview is the same as the content displayed in the corresponding area before the subview was set as a rounded corner view, ensuring the normal display of the subview and realizing the compensation display view for the target first rounded corner area.
[0055] When displaying parent and child views, the first display view can be displayed in the first rounded corner area of the target.
[0056] When the first view is displayed, it can be displayed as a child view of the parent view or as a child view of a child view.
[0057] The first display view can be displayed corresponding to the region position of the target first rounded corner area. Displaying the first display view in the target first rounded corner area can include displaying the first display view within the view display area of the target first rounded corner area.
[0058] In the embodiments of this disclosure, when compensating for the display of the target first rounded corner area, a first display view can be generated based on the display content of the subview in the target first rounded corner area. The first display view can compensate for the display of the target first rounded corner area, so that rounded corner areas that do not need to be displayed are compensated and displayed normally. By displaying the parent view, subview, and first display view simultaneously, off-screen rendering can be avoided while ensuring the normal display of subviews, thereby improving the display efficiency and effectiveness of the view.
[0059] like Figure 6 The diagram shown is a flowchart of another embodiment of a rounded corner view display method provided by this disclosure. The method may include the following steps:
[0060] S601: Set both the parent view and the child view to be displayed as rounded corner views, and obtain multiple first rounded corner areas of the child view and multiple second rounded corner areas of the parent view.
[0061] In this context, the child view depends on the parent view when it is displayed.
[0062] It should be noted that some steps in the embodiments of this disclosure are different from those in the present disclosure. Figure 2 Some steps in the illustrated embodiments are the same, and for the sake of brevity, they will not be repeated here.
[0063] S602: For a target first rounded corner region in multiple first rounded corner regions, if it is determined that there is no second rounded corner region in multiple second rounded corner regions that overlaps with the target first rounded corner region, then the target first rounded corner region is displayed in a compensated manner.
[0064] S603: For a target second rounded corner region in multiple second rounded corner regions, if it is determined that there is no first rounded corner region in multiple first rounded corner regions that overlaps with the target second rounded corner region, then the target second rounded corner region is displayed in a compensated manner.
[0065] The target second rounded corner region can be determined from second rounded corner regions that do not overlap with any of the first rounded corner regions. If the target second rounded corner region overlaps with the first rounded corner regions, it can include regions that are the same or partially the same as the first rounded corner regions.
[0066] In this embodiment of the disclosure, when the target second rounded corner area does not overlap with multiple first rounded corner areas, compensation display can be applied to the target second rounded corner area. Setting compensation display for the target second rounded corner area of the parent view ensures that the display of the parent view in the target second rounded corner area is the same as before the rounded corner is set, achieving normal view display. During the display process, off-screen rendering can be avoided, improving the display efficiency of the parent view.
[0067] In one possible design, the method further includes: obtaining the non-rounded corner display area set by the user for the parent view; determining the target second rounded corner area belonging to the non-rounded corner display area from the remaining second rounded corner areas other than the target second rounded corner area to be compensated; and compensating the target second rounded corner area belonging to the non-rounded corner display area.
[0068] In another possible design, it also includes: detecting the user's selection operation triggered on any second rounded corner area, obtaining the target second rounded corner area selected by the user, and compensating for the target second rounded corner area selected by the user.
[0069] In this embodiment of the disclosure, the user can set the area for compensation display, thereby enabling the user to accurately locate the display area and improve display accuracy.
[0070] As one embodiment, compensating for the second rounded corner area of the target by displaying it includes:
[0071] For the target second rounded corner area, a second display view is generated based on the content displayed by the parent view in the target second rounded corner area;
[0072] When displaying the parent view and child view, a second display view is displayed in the target's second rounded corner area.
[0073] The content displayed in the second display view can be the same as that of the parent view in the target second rounded corner area. When displayed, the display effect of the parent view is the same as that of the parent view when it is not set as a rounded corner view.
[0074] In this embodiment of the disclosure, when compensating for the display of the target's second rounded corner area, a second display view can be generated based on the display content of the parent view in the target's second rounded corner area. The second display view can compensate for the display of the target's second rounded corner area, so that rounded corner areas that do not need to be displayed are compensated and displayed normally. By displaying the parent view, child view, and second display view simultaneously, off-screen rendering can be avoided while ensuring the normal display of the parent view, thereby improving the display efficiency and effectiveness of the view.
[0075] In one possible design, the view display area of the second display view can be determined by: obtaining the area difference between the original area of the target second rounded corner area and the target second rounded corner area before the parent view is set as a rounded corner view; and by splicing the area difference with the target second rounded corner area, the view display area of the second display view can be obtained.
[0076] The content displayed by the parent view within the target's second rounded corner area can include the display color of the parent view within that area. The displayed content may also include data such as the arc of the parent view within the target's second rounded corner area and the center of that arc.
[0077] The display area of any second display view can be calculated based on the regional position data of the target second rounded corner region. For example, the length and width of the rectangular region of the second display view can be calculated using the regional position data of the arc and the center of the arc of the target second rounded corner region, and the location point of the center of the rectangle can be determined.
[0078] When the second display view is displayed, the content displayed in the target second rounded corner area in the parent view is the same as before the parent view was set as a rounded corner view, ensuring the normal display of the parent view.
[0079] The second display view can be generated in the same way and with the same shape as the first display view, but the size can be different. The second display view is a compensation display view for the second rounded corner area of the target.
[0080] When displaying the parent view and child view, a first display view is displayed in the first rounded corner area of the target and a second display view is displayed in the second rounded corner area of the target.
[0081] The second display view can be displayed as a child view of the parent view. Displaying the second display view within the target second rounded corner area can include displaying the second display view within a view display area that matches the target second rounded corner area.
[0082] In practical applications, multiple first rounded corner areas and multiple second rounded corner areas may not share the same rounded corner area. That is, the display of multiple first rounded corner areas in a subview does not affect the display of multiple second rounded corner areas in the parent view. In this case, compensation can be applied to a portion of the second rounded corner areas in the parent view to achieve normal display of that portion without triggering off-screen rendering.
[0083] As one possible implementation, the method may also include:
[0084] If there is no overlap between the multiple first rounded corner regions and the multiple second rounded corner regions, then any second rounded corner region is selected from the multiple second rounded corner regions for compensation display.
[0085] In this embodiment, when there is no overlap between the multiple first rounded corner regions and the multiple second rounded corner regions, any second rounded corner region can be selected from the multiple second rounded corner regions for compensation display. This achieves supplementary compensation display of the parent view, making the display of the parent view more effective.
[0086] In some embodiments, the plurality of second rounded corner regions may include: an upper left rounded corner region, a lower left rounded corner region, an upper right rounded corner region, and a lower right rounded corner region.
[0087] User-defined display positions can include the coordinates of the lower left and lower right corners of the parent view.
[0088] The process of obtaining the target second rounded corner area selected by the user can include:
[0089] Select the lower left rounded corner area and / or the lower right rounded corner area of the parent view from the area to be displayed.
[0090] In this embodiment of the disclosure, when the rounded corner areas of each view are determined, they may typically include the upper left rounded corner area, the lower left rounded corner area, the upper right rounded corner area, and the lower right rounded corner area. In order to ensure that the selected display area does not affect the user's use, the lower rounded corner area, such as the lower left and / or lower right rounded corner area, can be determined as the area that meets the display conditions, so as to enable the user to effectively select the compensation display area.
[0091] As one example, setting both the parent view and the child view to be displayed as rounded corner views can include:
[0092] In mobile operating systems, the view rounded corner parameter is used to set both the parent and child views to be displayed as rounded corner views.
[0093] The mobile operating system can be (iOS, iPhone Operating System), and the view corner radius parameter (layer.cornerRadius, view.cornerradius) can be used to set both the parent view and the child view to rounded corners.
[0094] Setting both a parent view and a child view to rounded corners using view rounded corner parameters can include: determining the parameter values for the parent view's view rounded corner parameters and the parameter values for the child view's view rounded corner parameters, and then setting the corresponding parameter values for both the parent view's view rounded corner parameters and the child view's view rounded corner parameters respectively, to obtain the parent view and child view set as rounded corner views.
[0095] In this embodiment of the disclosure, for mobile operating systems, the rounded corner parameters of the view can be used to set the rounded corners of the parent view and the child view, thereby achieving quick rounded corner setting of the parent view and the child view.
[0096] As another embodiment, the target first rounded corner area may include multiple regions; generating a first display view based on the display content of the subviews in the target first rounded corner area may include:
[0097] Create a display processing task for each target's first rounded corner area according to its display content in the subview, and add the display processing task for each target's first rounded corner area to the message queue;
[0098] Each display processing task is read sequentially from the message queue and executed. A first display view is generated for each target first rounded corner area according to its display content in the subview.
[0099] When reading and executing each display processing task sequentially from the message queue, each task can be read from the address of the message queue in a last-in-first-out (LIFO) order until the message queue is empty.
[0100] In this embodiment of the disclosure, when displaying a corresponding first display view for a target first rounded corner area, a corresponding display processing task can be established for each target first rounded corner area according to the display content of each target first rounded corner area in the subview. The display processing task can be added to a message queue, allowing each display processing task to be read and executed sequentially from the message queue. This sequential execution of tasks in the message queue generates a matching first display view for each target first rounded corner area according to its display content in the subview. By establishing and executing display processing tasks, the view display can be completed quickly, effectively improving the view display efficiency.
[0101] In practical applications, when displaying corresponding display views for the target second rounded corner area and the third display area, in addition to the target first rounded corner area, a display processing task can also be created. The specific implementation method is the same as that for the target first rounded corner area. This improves the display efficiency of the second display view for each target second rounded corner area. For example, for each target second rounded corner area, a display processing task can be created according to its display content in the parent view, and the display processing task for each target second rounded corner area can be added to a message queue. Each display processing task can be read from the message queue sequentially and executed to generate a matching second display view for each target second rounded corner area according to its display content in the parent view.
[0102] like Figure 7 The diagram shown is a structural schematic of one embodiment of a rounded corner view display device provided in this disclosure. The rounded corner view display device 700 may include the following units:
[0103] Rounded corner setting unit 701: used to set both the parent view and the child view to be displayed as rounded corner views, and obtain multiple first rounded corner areas of the child view and multiple second rounded corner areas of the parent view; the child view depends on the parent view when it is displayed.
[0104] First compensation unit 702: When it is determined that there is no second rounded corner region overlapping with the target first rounded corner region in multiple first rounded corner regions, the target first rounded corner region is compensated and displayed.
[0105] As one embodiment, the first compensation unit may include:
[0106] The first generation module is used to generate a first display view based on the display content of the subview in the target first rounded corner area;
[0107] The first display module is used to display the first display view in the first rounded corner area of the target when displaying the parent view and the child view.
[0108] In one possible design, the rounded corner view display device 700 may further include:
[0109] The second compensation unit is used to compensate and display the target second rounded corner area when it is determined that there is no first rounded corner area overlapping with the target second rounded corner area in the multiple first rounded corner areas.
[0110] In one possible design, the second compensation unit may include:
[0111] The second generation module is used to generate a second display view for the target second rounded corner area based on the display content of the parent view in the target second rounded corner area;
[0112] The second display module is used to display a second display view in the target second rounded corner area when displaying the parent view and the child view.
[0113] In some embodiments, the rounded corner setting unit may include:
[0114] The rounded corner setting module is used in mobile operating systems to set both the parent and child views to rounded corners using view rounded corner parameters.
[0115] As one embodiment, the target first rounded corner region may include multiple regions; the first generation module may include:
[0116] The message adding module is used to create display processing tasks for each target's first rounded corner area according to its display content in the subview, and add the display processing tasks for each target's first rounded corner area to the message queue.
[0117] The task execution module is used to read each display processing task sequentially from the message queue and execute it, and to generate a first display view for each target first rounded corner area according to its display content in the subview.
[0118] The apparatus provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effects are similar, and will not be described again here.
[0119] To implement the above embodiments, this disclosure also provides an electronic device.
[0120] refer to Figure 8 The diagram illustrates a structural schematic of an electronic device 800 suitable for implementing embodiments of the present disclosure. The electronic device 800 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 8 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0121] like Figure 8As shown, the electronic device 800 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. The RAM 803 also stores various programs and data required for the operation of the electronic device 800. The processing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0122] Typically, the following devices can be connected to I / O interface 805: input devices 806 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 807 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 808 including, for example, magnetic tapes, hard disks, etc.; and communication devices 809. Communication device 809 allows electronic device 800 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 8 An electronic device 800 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0123] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by a processing device 801, it performs the functions defined in the methods of embodiments of this disclosure.
[0124] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0125] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0126] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0127] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0128] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0129] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0130] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used may include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0131] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0132] In a first aspect, according to one or more embodiments of the present disclosure, a method for displaying rounded corner views is provided, which may include:
[0133] Set both the parent view and the child view to be displayed as rounded corner views to obtain multiple first rounded corner areas of the child view and multiple second rounded corner areas of the parent view; the child view depends on the parent view when it is displayed.
[0134] For a target first rounded corner region in multiple first rounded corner regions, if it is determined that there is no second rounded corner region in multiple second rounded corner regions that overlaps with the target first rounded corner region, then the target first rounded corner region is displayed in a compensated manner.
[0135] According to one or more embodiments of this disclosure, compensating for the target first rounded corner region includes:
[0136] A first display view is generated based on the content displayed by the subview in the first rounded corner area of the target;
[0137] When displaying the parent view and child view, the first display view is displayed in the first rounded corner area of the target.
[0138] According to one or more embodiments of this disclosure, it further includes:
[0139] For a target second rounded corner region in multiple second rounded corner regions, if it is determined that there is no first rounded corner region in multiple first rounded corner regions that overlaps with the target second rounded corner region, then the target second rounded corner region is displayed in a compensated manner.
[0140] According to one or more embodiments of this disclosure, compensating for the second rounded corner region of the target includes:
[0141] For the target second rounded corner area, a second display view is generated based on the content displayed by the parent view in the target second rounded corner area;
[0142] When displaying the parent view and child view, a second display view is displayed in the target's second rounded corner area.
[0143] According to one or more embodiments of this disclosure, setting both the parent view and the child view to be displayed as rounded corner views includes:
[0144] Use the view rounded corner parameter to set both the parent and child views to be displayed as rounded corner views.
[0145] According to one or more embodiments of this disclosure, the target first rounded corner region includes multiple regions; a first display view is generated based on the display content of the subviews in the target first rounded corner region, including:
[0146] Create a display processing task for each target's first rounded corner area according to its display content in the subview, and add the display processing task for each target's first rounded corner area to the message queue;
[0147] Each display processing task is read sequentially from the message queue and executed. For each target first rounded corner area, a first display view is generated according to its display content in the subview.
[0148] Secondly, according to one or more embodiments of this disclosure, a rounded corner view display device is provided, which may include:
[0149] The rounded corner setting unit is used to set both the parent view and the child view to be displayed as rounded corner views, obtaining multiple first rounded corner areas of the child view and multiple second rounded corner areas of the parent view; the child view depends on the parent view when it is displayed.
[0150] The first compensation unit is used to compensate and display the target first rounded corner area when it is determined that there is no second rounded corner area overlapping with the target first rounded corner area in the multiple first rounded corner areas.
[0151] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, which may include: a plurality of processors and a memory;
[0152] The memory stores the instructions that the computer executes;
[0153] Multiple processors execute computer execution instructions stored in memory, causing the multiple processors to perform the rounded corner view display method as described in the first aspect above and various possible designs of the first aspect.
[0154] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, which stores computer-executable instructions that, when executed by a processor, implement the rounded corner view display method described above and various possible designs of the first aspect.
[0155] Fifthly, according to one or more embodiments of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the rounded corner view display method as described in the first aspect above and various possible designs of the first aspect.
[0156] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0157] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0158] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for displaying rounded corner views, characterized in that, include: Set both the parent view and the child view to be displayed as rounded corner views to obtain multiple first rounded corner areas of the child view and multiple second rounded corner areas of the parent view; The child view depends on the parent view when it is displayed; If, for a target first rounded corner region within the plurality of first rounded corner regions, it is determined that there is no second rounded corner region within the plurality of second rounded corner regions that overlaps with the target first rounded corner region, then the target first rounded corner region is displayed in a compensated manner.
2. The method of claim 1, wherein, The compensation display for the first rounded corner area of the target includes: A first display view is generated based on the content displayed by the subview in the first rounded corner area of the target; When displaying the parent view and the child view, the first display view is displayed in the first rounded corner area of the target.
3. The method of claim 1, wherein, Also includes: For the target second rounded corner region in the plurality of second rounded corner regions, if it is determined that there is no first rounded corner region in the plurality of first rounded corner regions that overlaps with the target second rounded corner region, then the target second rounded corner region is displayed in a compensated manner.
4. The method of claim 3, wherein, The compensation display for the second rounded corner area of the target includes: For the target second rounded corner area, a second display view is generated based on the display content of the parent view in the target second rounded corner area; When the parent view and the child view are displayed, the second display view is displayed in the target second rounded corner area.
5. The method of claim 1, wherein, Setting both the parent view and child view to be displayed as rounded corner views includes: The parent view and the child view to be displayed are both set to rounded corners using the view rounded corner parameter.
6. The method of claim 2, wherein, The target first rounded corner area includes multiple regions; generating a first display view based on the display content of the subview in the target first rounded corner area includes: Create a display processing task for each target's first rounded corner area according to its display content in the subview, and add the display processing task for each target's first rounded corner area to the message queue; Each display processing task is read sequentially from the message queue and executed, and a first display view is generated for each target first rounded corner area according to its display content in the subview.
7. A rounded corner view display device, characterized in that, include: A rounded corner setting unit is used to set both the parent view and the child view to be displayed as rounded corner views, thereby obtaining multiple first rounded corner areas of the child view and multiple second rounded corner areas of the parent view; The child view depends on the parent view when it is displayed; The first compensation unit is used to compensate and display the target first rounded corner region when it is determined that there is no second rounded corner region overlapping with the target first rounded corner region in the plurality of second rounded corner regions.
8. An electronic device, comprising: include: Processor, memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the rounded corner view display method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the rounded corner view display method as described in any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by a processor to configure the rounded corner view display method as described in any one of claims 1 to 6.