View control method, device, electronic device and computer readable storage medium

Through the view control method, the size and position relationship of the advertising position view are obtained, the offset direction and offset of the target advertising image are determined, and the border indentation attribute is set, which solves the problem of high workload when adjusting the size and position of the advertising image in the prior art, and realizes more flexible page adjustment.

CN116661919BActive Publication Date: 2025-04-15CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310463884.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-26
Publication Date
2025-04-15
Estimated Expiration
2043-04-26

AI Technical Summary

Technical Problem

In the prior art, since the size and position of the advertisement image are adjusted based on the image data sent back by the server, it will involve calculating and adjusting the layout of the entire page, resulting in a large workload and inflexible enough.

Method used

Provide a view control method, by creating the view to be displayed on the page, obtaining the size information and relative position relationship of the advertising position view, obtaining the target advertising image and position requirement information, determining the offset direction and offset of the target advertising image in the advertising position view, and setting the border indentation properties of the advertising position view, so that other views can adjust their position according to the offset direction and offset.

Benefits of technology

Through this method, the calculation adjustment of the entire page layout is reduced, the workload is reduced, and the adjustment flexibility is improved, and the workload problem caused by adjusting the size and position of the advertising map in the prior art is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116661919B_ABST
    Figure CN116661919B_ABST
Patent Text Reader

Abstract

The present application relates to a view control method, a view control device, an electronic device and a computer-readable storage medium. The view control method includes: creating a view to be displayed on a page; obtaining the size information of the ad slot view and the relative position relationship between the views; obtaining the target ad image to be displayed on the ad slot view and the position requirement information for the target ad image; determining the target offset direction and the corresponding target offset of the edge of the target ad image relative to the corresponding edge of the ad slot view based on the relative position relationship, size information and position requirement information; and setting the border indentation property of the ad slot view based on the target offset direction and target offset. The use of the view control method can solve the problem of a large workload caused by the large amount of work involved in calculating and adjusting the layout of the entire page when adjusting the size and position of the ad image based on the image data returned by the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a view control method, a view control device, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the development of electronic products, electronic products are increasingly widely used in daily life due to their convenience and efficiency. In electronic products, the application (Application, App) page contains advertising space. Based on the diversity of advertising content, it is usually necessary to adjust the size and position of the advertising space view accordingly to deliver different advertising content.

[0003] However, adjusting the size and position of the advertisement image according to the image data returned by the server involves calculating and adjusting the layout of the entire page and refreshing the page, which results in a large workload and lacks flexibility. Summary of the invention

[0004] Based on this, a view control method, a view control device, an electronic device and a computer-readable storage medium are provided to solve the problem in the prior art that adjusting the size and position of an advertisement image according to image data returned by a server involves calculating and adjusting the layout of the entire page, resulting in a large workload.

[0005] On the one hand, a view control method is provided, which is applied to a terminal, and the view control method includes: creating a view to be displayed on a page, the view including an ad slot view and other views; obtaining size information of the ad slot view and the relative position relationship between each of the views; obtaining a target advertising image to be displayed on the ad slot view and position requirement information for the target advertising image; determining, based on the relative position relationship, the size information and the position requirement information, a target offset direction and a corresponding target offset amount of an edge of the target advertising image relative to a corresponding edge of the ad slot view when the target advertising image is displayed at a specified position of the ad slot view; and setting a border indentation attribute of the ad slot view based on the target offset direction and the target offset amount, so that the other views can adjust their own positions based on the target offset direction and the target offset amount.

[0006] In one of the embodiments, obtaining the size information of the ad space view and the relative position relationship between each of the views includes: obtaining the original advertisement image currently to be displayed on the ad space view, and obtaining image requirement information for the original advertisement image; the image requirement information includes at least one of size requirement information and content requirement information; and processing the original advertisement image based on the image requirement information to obtain a target advertisement image.

[0007] In one of the embodiments, when the image requirement information includes size requirement information, and the size requirement information includes a target size, processing the original advertisement image based on the image requirement information to obtain a target advertisement image includes: obtaining the original size of the original advertisement image; determining a target scaling ratio value based on the target size and the original size; and processing the original advertisement image based on the target scaling ratio value to obtain a target advertisement image.

[0008] In one of the embodiments, the target size includes a target height and a target width, the original size includes an original height and an original width, and determining the target scaling ratio value based on the target size and the original size includes: calculating a scaling ratio value of the height based on the target height and the original height; calculating a scaling ratio value of the width based on the target width and the original width; and determining the target scaling ratio value based on the scaling ratio value of the height and the scaling ratio value of the width.

[0009] In one of the embodiments, determining the target scaling ratio value according to the scaling ratio value of the height and the scaling ratio value of the width includes: selecting one of the scaling ratio value of the height and the scaling ratio value of the width as the target scaling ratio value according to a preset scaling ratio value selection rule.

[0010] In one of the embodiments, when determining to display the target advertising image at a specified position of the advertising space view, the target offset direction and the corresponding target offset amount of the edge of the target advertising image relative to the corresponding edge of the advertising space view include: receiving the target offset direction and the corresponding target offset amount of the edge of the target advertising image relative to the corresponding edge of the advertising space view from the outside.

[0011] In one of the embodiments, when determining to display the target advertising image at a specified position of the advertising space view, the target offset direction and the corresponding target offset of the edge of the target advertising image relative to the corresponding edge of the advertising space view also include: calculating the target offset and the corresponding target offset direction between the edge of the target advertising image and the corresponding edge of the advertising space view.

[0012] On the other hand, a view control device is provided, which includes: a creation module, a first acquisition module, a second acquisition module, a determination module and a processing module, wherein the creation module is used to create a view to be displayed on the page, and the view includes an ad slot view and other views; the first acquisition module is used to obtain the size information of the ad slot view and the relative position relationship between each of the views; the second acquisition module is used to obtain the target advertising image to be currently displayed on the ad slot view and the position requirement information for the target advertising image; the determination module is used to determine the target offset direction and the corresponding target offset of the edge of the target advertising image relative to the corresponding edge of the ad slot view when the target advertising image is displayed at a specified position of the ad slot view according to the relative position relationship, the size information and the position requirement information; the processing module is used to set the border indentation attribute of the ad slot view according to the target offset direction and the target offset, so that the other views can adjust their own positions according to the target offset direction and the target offset.

[0013] On the other hand, an electronic device is provided, comprising a processor, a memory, a communication interface and a bus, wherein the processor, the memory and the communication interface are connected via the bus, the memory is used to store instructions and computer programs of the above-mentioned view control method, the processor is used to read the instructions and computer programs stored in the memory and execute them to implement the above-mentioned view control method, and the communication interface is used to implement information interaction.

[0014] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned view control method is implemented.

[0015] The above-mentioned view control method, view control device, electronic device and computer-readable storage medium create a view to be displayed on the page, wherein the view includes an ad slot view and other views; obtains the size information of the ad slot view and the relative position relationship between each of the views; obtains the target advertising image to be currently displayed on the ad slot view and the position requirement information for the target advertising image; determines, based on the relative position relationship, the size information and the position requirement information, the target offset direction and the corresponding target offset of the edge of the target advertising image relative to the corresponding edge of the ad slot view when the target advertising image is displayed at the specified position of the ad slot view; sets the border indentation attribute of the ad slot view according to the target offset direction and the target offset, so that the other views can adjust their own positions according to the target offset direction and the target offset, thereby solving the problem of heavy workload caused by the calculation and adjustment of the layout of the entire page when adjusting the size and position of the advertising image according to the image data returned by the server. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A flowchart of a view control method disclosed in an embodiment of the present application;

[0017] Figure 2 for Figure 1 The flowchart of step S20 in the view control method shown is as follows;

[0018] Figure 3 for Figure 2 The flowchart of step S22 in the view control method shown is as follows;

[0019] Figure 4 for Figure 1 The flowchart of step S40 in the view control method shown is as follows;

[0020] Figure 5 for Figure 4 An example diagram of step S42 in the view control method shown;

[0021] Figure 6 for Figure 4 Another example diagram of step S42 in the view control method shown;

[0022] Figure 7 for Figure 1 The flowchart of step S50 in the view control method shown is as follows;

[0023] Figure 8 A schematic diagram of the structure of a view control device disclosed in an embodiment of the present application;

[0024] Fig. 9A schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0026] It should be noted that the diagram provided in the present embodiment only illustrates the basic concept of the present invention in a schematic manner, so the diagram only shows the components related to the present invention rather than drawing according to the number, shape and size of the components during actual implementation. The type, quantity and ratio of each component during actual implementation can be a random change, and the component layout type may also be more complicated. The structure, ratio, size, etc. illustrated in the drawings of the present specification are only used to match the content disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the limiting conditions that the present invention can implement, so they have no technical substantive significance. Any modification of the structure, change of the proportional relationship or adjustment of the size should still fall within the scope of the technical content disclosed by the present invention without affecting the effect that the present invention can produce and the purpose that can be achieved. At the same time, the terms such as "upper", "lower", "left", "right", "middle" and "one" quoted in this specification are only for the convenience of narration, and are not used to limit the scope of the present invention. The change or adjustment of its relative relationship should also be regarded as the scope of the present invention without substantially changing the technical content.

[0027] With the development of electronic products, electronic products are increasingly widely used in daily life due to their convenience and efficiency. In electronic products, the application (Application, App) page contains advertising space. Based on the diversity of advertising content, it is usually necessary to adjust the size and position of the advertising space view accordingly to deliver different advertising content. However, adjusting the size and position of the advertising image according to the image data returned by the server will involve calculating and adjusting the layout of the entire page and refreshing the page, which results in a large workload and lack of flexibility.

[0028] Based on this, the present application hopes to provide a solution that can solve the above-mentioned technical problems, which can solve the problem of large workload caused by adjusting the size and position of the advertisement image according to the image data returned by the server, which involves calculating and adjusting the layout of the entire page. The details will be explained in subsequent embodiments.

[0029] The present application provides a detailed description of a view control method, a view control device, an electronic device and a computer-readable storage medium.

[0030] See also Figure 1 , which is a flow chart of a view control method disclosed in an embodiment of the present application. In the implementation of the present application, the view control method is applied to a terminal, and the flow of the view control method includes at least the following steps.

[0031] S10. Create views to be displayed on the page, including ad slot views and other views.

[0032] In an embodiment of the present application, specifically, a view to be displayed on a page is created, and the view includes an ad slot view and other views. Among them, the ad slot view is used to display advertisements, and can also be used to implement other functions required by business needs. Other functions required by business needs may include: multi-image carousel display (that is, each advertisement image completely or partially occupies the current ad slot view, and automatically flips to the next page of advertisement images at a preset interval), click events for each advertisement image, and filter effect views for advertisement images. In order to meet the interaction and animation requirements of the business needs, the ad slot view can be a composite control composed of multiple sub-controls, wherein the ad slot view includes at least one UIImageView or a UIView or another control that can display images (such as a button UIButton).

[0033] S20: Obtain size information of the advertisement slot views and relative positional relationships between the views.

[0034] S30: Acquire the target advertisement picture to be displayed on the advertisement position view and the position requirement information of the target advertisement picture.

[0035] S40. Determine, based on the relative position relationship, the size information, and the position requirement information, a target offset direction and a corresponding target offset amount of an edge of the target advertising image relative to a corresponding edge of the advertising space view when the target advertising image is displayed at a specified position of the advertising space view.

[0036] S50: Setting the border indentation attribute of the advertisement slot view according to the target offset direction and the target offset, so that the other views can adjust their positions according to the target offset direction and the target offset.

[0037] See also Figure 2 In the implementation manner of the present application, step S20 at least includes the following steps.

[0038] S21. Acquire the original advertisement image currently to be displayed on the advertisement position view, and acquire image requirement information for the original advertisement image; the image requirement information includes at least one of size requirement information and content requirement information.

[0039] S22: Process the original advertisement image based on the image requirement information to obtain a target advertisement image.

[0040] See also Figure 3 In an implementation manner of the present application, when the image requirement information includes size requirement information, and the size requirement information includes a target size, the step S22 at least includes the following steps.

[0041] S221. Obtain the original size of the original advertisement image.

[0042] S222: Determine a target scaling ratio value according to the target size and the original size.

[0043] In an embodiment of the present application, a scaling ratio value of the height is calculated according to the target height and the original height, a scaling ratio value of the width is calculated according to the target width and the original width, and then a target scaling ratio value is determined according to the scaling ratio value of the height and the scaling ratio value of the width. Among them, one is selected from the scaling ratio value of the height and the scaling ratio value of the width as the target scaling ratio value according to a preset scaling ratio value selection rule. Specifically, taking the original height of 60, the original width of 40, the target height of 180 and the target width of 80 as an example, the scaling ratio value of the height calculated according to the target height and the original height is 180 / 60 (i.e., equal to 3), and the scaling ratio value of the width calculated according to the target width and the original width is 80 / 40 (i.e., equal to 2). When business needs allow a certain image to exceed the frame of the ad slot view, the maximum zoom ratio value (i.e., the zoom ratio value of the height) is used to determine the target zoom ratio value; when business needs do not allow a certain image to exceed the frame of the ad slot view, the minimum zoom ratio value (i.e., the zoom ratio value of the width) is used to determine the target zoom ratio value.

[0044] S223: Process the original advertisement image based on the target zoom ratio value to obtain a target advertisement image.

[0045] In an embodiment of the present application, taking the target zoom ratio value of 3, the original width of 40, and the original height of 60 as an example, the original width of the original advertising image is multiplied by the target zoom ratio value to obtain the actual width of the target advertising image (i.e., 40*3=120), and the original height of the original advertising image is multiplied by the target zoom ratio value to obtain the actual height of the target advertising image (i.e., 60*3=180), and the original advertising image is cropped according to the business needs.

[0046] Taking the business requirement of retaining the middle part of the original advertising image as an example, when the target height and the actual height of the target advertising image are both 180, the height of the original advertising image meets the requirement; when the target width is 80 and the actual width of the target advertising image is 120, it is necessary to process the width of the original advertising image, and calculate the clipping length of the width: 120-80=40. Since the middle part of the original advertising image is retained, 20 are clipped on the left and right sides of the original advertising image to obtain the target advertising image.

[0047] In the implementation manner of the present application, when the image requirement information includes size requirement information and content requirement information, the step S22 also includes processing the target advertising image based on the content requirement information. Specifically, when the control used by the ad slot view to display the image is UIImageView, its attribute image is set to the target advertising image, and relevant filter effects are added according to the business requirements; when the control used by the ad slot view to display the image is UIView and its subclass, a new layer is added to it, the attribute content of the new layer is set to the target advertising image, and relevant filter effects are added according to the business requirements; or, when the control used by the ad slot view to display the image is UIView and its subclass, its draw(:) method is rewritten, the target advertising image is drawn in the drawing context, and relevant filter effects are added according to the business requirements; or, when the control used by the ad slot view to display the image is UIView and its subclass, a new layer is added to it, the draw(:in:) method of the new layer is rewritten, the target advertising image is drawn in the drawing context, and relevant filter effects are added according to the business requirements.

[0048] See also Figure 4 In the implementation manner of the present application, the step S40 at least includes the following steps.

[0049] S41: Receive from the outside a target offset direction and a corresponding target offset of an edge of the target advertisement image relative to a corresponding edge of the advertisement slot view.

[0050] S42: Calculate a target offset and a corresponding target offset direction between an edge of the target advertisement image and a corresponding edge of the advertisement slot view.

[0051] In the embodiments of this application, please refer to Figure 5, taking the example that the width of the ad slot view is 400 and the height is 200, the width of the target ad image is 20 and the height is 20, and the coordinates of the upper left point of the target ad image are (x:0, y:0), when the upper left point of the target ad image coincides with the upper left position of the ad slot view, the target offset is calculated, and the horizontal left target offset is 0; the horizontal right target offset is the width of the ad slot view minus the width of the target ad image (i.e. 400-20=380), and since the other views are indented into the ad slot view, the horizontal right target offset is a negative number (i.e. -380); the vertical upper target offset is 0; the vertical lower target offset is the height of the ad slot view minus the height of the target ad image (i.e. 200-20=180), and since the other views are indented into the ad slot view, the vertical lower target offset is a negative number (i.e. -180).

[0052] See also Figure 6 , take the example that the width of the ad slot view is 400 and the height is 200, the width of the target ad image is 400 and the height is 200, and the center point coordinates of the target ad image are (x:10, y:10). When the center point of the target ad image coincides with the center point of the ad slot view, the target offset is calculated. The horizontal left target offset is the width of the ad slot view divided by 2 minus the x coordinate value of the center point of the target ad image (i.e. 400 / 2-10=190). Since the other views are indented into the ad slot view, the horizontal left target offset is a negative number (i.e. -1 90); the horizontal right target offset is the width of the ad slot view divided by 2 minus the x-coordinate value of the center point of the target ad image (i.e. 400 / 2-10=190); the vertical upper target offset is the height of the ad slot view divided by 2 minus the y-coordinate value of the center point of the target ad image (i.e. 200 / 2-10=90). Since the other views are indented into the ad slot view, the vertical upper target offset is a negative number (i.e. -90); the vertical lower target offset is the height of the ad slot view divided by 2 minus the y-coordinate value of the center point of the target ad image (i.e. 200 / 2-10=90).

[0053] See also Figure 7 In the implementation manner of the present application, the step S50 at least includes the following steps.

[0054] S51. Set a border indentation attribute of the advertisement slot view according to the target offset direction and the target offset amount received from the outside.

[0055] In an embodiment of the present application, specifically, when the control used by the ad space view to display images is UIImageView, the withAlignmentRectInsets(:) method of the target ad image is called, and the method parameters are passed in to the target offset direction and the target offset received from the outside to obtain the target ad image with the offset set, and then the target ad image with the offset is reassigned to the image property of UIImageView.

[0056] When the control used by the ad slot view to display images is UIView and its subclasses, the alignmentRectInsets property of UIView is directly set to the target offset direction and the target offset received from the outside.

[0057] S52: Setting a border indentation attribute of the advertisement slot view according to the calculated target offset direction and the target offset amount.

[0058] To summarize, in the view control method of the present application, a view to be displayed on a page is created, the view including an ad slot view and other views; the size information of the ad slot view and the relative position relationship between each of the views are obtained; the target advertising image to be displayed on the ad slot view and the position requirement information of the target advertising image are obtained; according to the relative position relationship, the size information and the position requirement information, the target offset direction and the corresponding target offset of the edge of the target advertising image relative to the corresponding edge of the ad slot view when the target advertising image is displayed at the specified position of the ad slot view are determined; the border indentation attribute of the ad slot view is set according to the target offset direction and the target offset, so that the other views can adjust their own positions according to the target offset direction and the target offset, thereby solving the problem of large workload caused by calculating and adjusting the layout of the entire page when adjusting the size and position of the advertising image according to the image data returned by the server.

[0059] It should be understood that although Figures 1 to 7 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figures 1 to 7At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0060] See also Figure 8 , which is a schematic diagram of the structure of a view control device disclosed in an embodiment of the present application. The present application provides a view control device 100, which may at least include a creation module 110, a first acquisition module 130, a second acquisition module 150, a determination module 170 and a processing module 180. The creation module 110 is connected to the first acquisition module 130, the first acquisition module 130 is connected to the second acquisition module 150, the second acquisition module 150 is connected to the determination module 170, and the determination module 170 is connected to the processing module 180.

[0061] The creation module 110 is used to create the view to be displayed on the page, and the view includes the ad slot view and other views. Among them, the ad slot view is used to display advertisements, and can also be used to implement other functions required by business needs. Other functions required by business needs may include: multi-image carousel display (that is, each advertisement image completely or partially occupies the current ad slot view, and automatically flips to the next page of advertisement images at a preset interval), click events for each advertisement image, and filter effect views for advertisement images. In order to meet the interaction and animation requirements of the business needs, the ad slot view can be a composite control composed of multiple sub-controls, wherein the ad slot view includes at least one UIImageView or a UIView or another control that can display images (such as a button UIButton).

[0062] The first acquisition module 130 is used to acquire the size information of the ad space view and the relative position relationship between the views. The original ad picture to be displayed on the ad space view is acquired, and the image requirement information of the original ad picture is acquired, the image requirement information includes at least one of size requirement information and content requirement information; and the original ad picture is processed based on the image requirement information to obtain the target ad picture.

[0063] In the embodiment of the present application, specifically, the height scaling value is calculated according to the target height and the original height, the width scaling value is calculated according to the target width and the original width, and then the target scaling value is determined according to the height scaling value and the width scaling value, and finally the original advertisement image is processed based on the target scaling value to obtain the target advertisement image. Among them, one of the height scaling value and the width scaling value is selected as the target scaling value according to the preset scaling value selection rule.

[0064] The second acquisition module 150 is used to acquire the target advertisement picture to be displayed on the advertisement position view and the position requirement information of the target advertisement picture.

[0065] The determination module 170 is used to determine the target offset direction and the corresponding target offset amount of the edge of the target advertising image relative to the corresponding edge of the advertising slot view when the target advertising image is displayed at the specified position of the advertising slot view according to the relative position relationship, the size information and the position requirement information. The target offset direction and the corresponding target offset amount of the edge of the target advertising image relative to the corresponding edge of the advertising slot view are received from the outside; or the target offset amount and the corresponding target offset direction between the edge of the target advertising image and the corresponding edge of the advertising slot view are calculated.

[0066] The processing module 180 is used to set the border indentation property of the ad space view according to the target offset direction and the target offset, so that the other views can adjust their own positions according to the target offset direction and the target offset. When the border indentation property of the ad space view is set according to the target offset direction and the target offset received from the outside, when the ad space view is used to display the image control as UIImageView, the withAlignmentRectInsets(:) method of the target advertising image is called, and the method parameters are passed into the target offset direction and the target offset received from the outside to obtain the target advertising image with the offset set, and then the target advertising image with the offset is reassigned to the image property of UIImageView; when the ad space view is used to display the image control as UIView and its subclasses, the alignmentRectInsets property of UIView is directly set to the target offset direction and the target offset received from the outside.

[0067] In the embodiment of the present application, the border indentation attribute of the advertisement slot view is set according to the calculated target offset direction and the target offset amount.

[0068] In summary, in the view control device of the present application, the creation module 110 creates a view to be displayed on the page, and the view includes an ad slot view and other views; the first acquisition module 130 acquires the size information of the ad slot view and the relative position relationship between each of the views; the second acquisition module 150 acquires the target advertising image to be currently displayed on the ad slot view and the position requirement information for the target advertising image; the determination module 170 determines the target offset direction and the corresponding target offset of the edge of the target advertising image relative to the corresponding edge of the ad slot view when the target advertising image is displayed at the specified position of the ad slot view according to the relative position relationship, the size information and the position requirement information; the processing module 180 sets the border indentation attribute of the ad slot view according to the target offset direction and the target offset, so that the other views can adjust their own positions according to the target offset direction and the target offset, thereby solving the problem of large workload caused by calculating and adjusting the layout of the entire page when adjusting the size and position of the advertising image according to the image data returned by the server.

[0069] See also Fig. 9 , which is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. The present application also provides an electronic device 10, including a processor 11, a memory 12, a communication interface 13 and a bus 14, wherein the processor 11, the memory 12 and the communication interface 13 are connected via the bus 14.

[0070] The processor 11 is used to read the instructions and computer programs stored in the memory 12 and execute them to achieve Figure 1 The view control method described in the illustrated embodiment.

[0071] The memory 12 is used to store Figure 1 The instructions and computer program of the view control method described in the illustrated embodiment. The communication interface 13 is used to implement information interaction.

[0072] The bus 14 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0073] The processor 11 may be a central processing unit (CPU), a network processor (NP), a graphic processing unit (GPU) or any combination of CPU, NP and GPU. It may also be a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0074] The present application also provides a computer-readable storage medium having a computer program stored thereon, which implements Figure 1 The view control method described in the illustrated embodiment.

[0075] These computer programs can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0076] These computer programs can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0077] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0078] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A view control method, characterized in that: Applied to terminals, including: Create views to be displayed on the page, including ad slot views and other views; Obtaining size information of the ad slot views and relative positional relationships between the views; Acquire the target advertisement picture currently to be displayed on the advertisement position view and the position requirement information of the target advertisement picture; Determining, according to the relative position relationship, the size information, and the position requirement information, a target offset direction and a corresponding target offset amount of an edge of the target advertising image relative to a corresponding edge of the advertising slot view when displaying the target advertising image at a specified position of the advertising slot view, including: Receiving from the outside a target offset direction and a corresponding target offset amount of an edge of the target advertisement image relative to a corresponding edge of the advertisement slot view; The border indentation properties of the ad slot view are set according to the target offset direction and the target offset, so that the other views can adjust their own positions according to the target offset direction and the target offset, wherein the properties include the image property of UIImageView and the alignmentRectInsets property of UIView.

2. The view control method according to claim 1, characterized in that: The step of obtaining a target advertisement image to be displayed on the advertisement position view includes: Acquire the original advertisement image currently to be displayed on the advertisement position view, and acquire image requirement information for the original advertisement image; the image requirement information includes at least one of size requirement information and content requirement information; The original advertisement picture is processed based on the picture requirement information to obtain a target advertisement picture.

3. The view control method according to claim 2, characterized in that: When the image requirement information includes size requirement information, and the size requirement information includes a target size, the processing the original advertisement image based on the image requirement information to obtain a target advertisement image includes: Obtaining the original size of the original advertisement image; Determine a target scaling value according to the target size and the original size; The original advertisement picture is processed based on the target zoom ratio value to obtain a target advertisement picture.

4. The view control method according to claim 3, characterized in that: The target size includes a target height and a target width, the original size includes an original height and an original width, and determining a target scaling ratio value according to the target size and the original size includes: Calculate a height scaling value according to the target height and the original height; Calculate the width scaling value according to the target width and the original width; A target scaling value is determined according to the scaling value of the height and the scaling value of the width.

5. The view control method according to claim 4, characterized in that: The determining a target scaling ratio value according to the scaling ratio value of the height and the scaling ratio value of the width includes: According to a preset scaling ratio value selection rule, one of the scaling ratio value of the height and the scaling ratio value of the width is selected as a target scaling ratio value.

6. The view control method according to claim 1, characterized in that: The determining to display the target advertisement image at the designated position of the advertisement slot view includes a target offset direction and a corresponding target offset amount of an edge of the target advertisement image relative to a corresponding edge of the advertisement slot view, and further includes: A target offset and a corresponding target offset direction between an edge of the target advertisement image and a corresponding edge of the advertisement slot view are calculated.

7. A view control device, characterized in that: The view control device comprises: a creation module, a first acquisition module, a second acquisition module, a determination module and a processing module, wherein: The creation module is used to create views to be displayed on the page, and the views include ad slot views and other views; The first acquisition module is used to acquire the size information of the advertising position views and the relative position relationship between the views; The second acquisition module is used to acquire the target advertisement picture to be displayed on the advertisement position view and the position requirement information of the target advertisement picture; The determination module is used to determine, according to the relative position relationship, the size information, and the position requirement information, a target offset direction and a corresponding target offset amount of an edge of the target advertisement image relative to a corresponding edge of the advertisement slot view when the target advertisement image is displayed at a specified position of the advertisement slot view, including: Receiving from the outside a target offset direction and a corresponding target offset amount of an edge of the target advertisement image relative to a corresponding edge of the advertisement slot view; The processing module is used to set the border indentation property of the advertising space view according to the target offset direction and the target offset, so that the other views can adjust their own positions according to the target offset direction and the target offset, wherein the properties include the image property of UIImageView and the alignmentRectInsets property of UIView.

8. An electronic device, characterized in that: The invention comprises a processor, a memory, a communication interface and a bus, wherein the processor, the memory and the communication interface are connected via the bus, the memory is used to store instructions and computer programs of the view control method according to any one of claims 1 to 6, the processor is used to read the instructions and computer programs stored in the memory and execute them to implement the view control method according to any one of claims 1 to 6, and the communication interface is used to implement information interaction.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the view control method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Object display page display method, electronic equipment and storage medium

    CN112650432A

  • Advertisement editing and releasing method, terminal and computer readable storage medium

    CN114036418A