Interface display adaptation method and device, electronic equipment and computer storage medium
By obtaining and adjusting the display elements of the display interface in the vehicle terminal device, and automatically adjusting the size and arrangement of the interface elements according to the resolution changes, the problem that UI design in the prior art is difficult to adapt to the display needs of different terminal devices, and the adaptive display of the interface and the improvement of user experience are achieved.
Patent Information
- Application Number
- CN202411816851.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-04
AI Technical Summary
The existing on-board UI designs are difficult to meet the display needs of different terminal devices, especially when the screen size and resolution change, a single UI design cannot automatically adapt to the display needs of different resolutions.
An interface display adaptation method is provided. By obtaining the first resolution and the second resolution of the display interface, the display elements of the display interface are obtained, and these elements are adjusted according to the second resolution to obtain target display elements adapted to the second resolution, and finally display these target elements on the display interface.
The adaptive display of the interface is realized, without the need to design interfaces with different resolutions separately. It can automatically adjust the size and arrangement direction of elements such as buttons, text, text boxes and lists to ensure that the interface is still usable and beautiful under different resolutions.
Smart Images

Figure CN119759227A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to an interface display adaptation method, device, electronic device, and computer storage medium. Background Art
[0002] With the development of smart cockpits, in-vehicle infotainment (IVI) systems are becoming more and more complex, and user interface (UI) design needs to meet multiple requirements.
[0003] Existing in-vehicle UI designs are usually optimized for specific screen sizes and resolutions. However, with the increase in the types of in-vehicle terminal devices, such as large central control screens, instrument panels, and head-up displays (HUDs), a single UI design is difficult to meet the display requirements of different terminals. Summary of the invention
[0004] In view of this, embodiments of the present application provide an interface display adaptation method, device, electronic device and computer storage medium to at least partially solve the above problems.
[0005] According to a first aspect of an embodiment of the present application, there is provided an interface display adaptation method, characterized by comprising:
[0006] Get the first resolution of the display interface;
[0007] When the resolution of the display interface changes to a second resolution, acquiring a display element of the display interface, wherein the first resolution is different from the second resolution;
[0008] Adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution;
[0009] The target display element is displayed on the display interface.
[0010] In some embodiments, the display element comprises a button;
[0011] The step of adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution includes:
[0012] When there are multiple buttons, determining a resolution variation range according to a difference between the first resolution and the second resolution;
[0013] When the resolution variation range belongs to the preset resolution variation range, determining a first adjustment coefficient according to the first resolution and the second resolution;
[0014] adjusting the sizes of the plurality of buttons according to the first adjustment coefficient to obtain a plurality of target buttons adapted to the second resolution, wherein the distance and position relationship between the plurality of target buttons at the second resolution are the same as the distance and position relationship between the plurality of buttons at the first resolution;
[0015] The displaying the target display element on the display interface includes:
[0016] The plurality of target buttons are displayed on the display interface.
[0017] In some embodiments, the display element comprises a button;
[0018] The step of adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution includes:
[0019] When there are multiple buttons, determining a resolution variation range according to a difference between the first resolution and the second resolution;
[0020] When the resolution variation range does not belong to the preset resolution variation range, obtaining arrangement directions of the plurality of buttons;
[0021] If the arrangement direction is a vertical direction and the second resolution is greater than the first resolution, or if the arrangement direction is a horizontal direction and the second resolution is less than the second resolution, determining a first adjustment coefficient according to the first resolution and the second resolution;
[0022] The sizes of the plurality of buttons are adjusted according to the first adjustment coefficient, and the arrangement directions of the plurality of buttons are adjusted to obtain a plurality of target buttons adapted to the second resolution.
[0023] In some embodiments, the display element includes text;
[0024] The step of adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution includes:
[0025] Determining a target text size corresponding to the second resolution according to a correspondence between resolution and text size;
[0026] The size of the text is adjusted to the target text size to obtain the text adapted to the second resolution.
[0027] In some embodiments, the display element includes a text box;
[0028] The step of adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution includes:
[0029] determining a second adjustment coefficient according to the first resolution and the second resolution;
[0030] Adjust the size of the text box according to the second adjustment coefficient to obtain a target text box;
[0031] Obtain the number of characters in a text line at the first resolution;
[0032] Determine the text line width according to the number of characters and the target text size;
[0033] When the text line width is greater than the target text box width, the number of lines of the target text box is increased to obtain the text box adapted to the second resolution.
[0034] In some embodiments, the display element comprises a list;
[0035] The step of adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution includes:
[0036] Determine the target number of list columns corresponding to the second resolution according to the corresponding relationship between the resolution and the number of list columns;
[0037] Setting the number of columns to the number of target list columns;
[0038] determining a third adjustment coefficient according to the first resolution and the second resolution;
[0039] The size of each column of the list is adjusted according to the third adjustment coefficient to obtain the list suitable for the second resolution.
[0040] In some embodiments, the method further comprises:
[0041] Determine the total list width according to the number of target list columns and the list width of the second resolution;
[0042] When the total width of the list is greater than the interface width corresponding to the second resolution variable, the list is scrolled and displayed.
[0043] According to a second aspect of an embodiment of the present application, there is provided an interface display adaptation device, characterized in that it includes:
[0044] A first acquisition module, used to acquire a first resolution of the display interface;
[0045] A second acquisition module, configured to acquire display elements of the display interface when the resolution of the display interface changes to a second resolution, wherein the first resolution is different from the second resolution;
[0046] an adjustment module, configured to adjust the display element according to the second resolution to obtain a target display element adapted to the second resolution;
[0047] A display module is used to display the target display element on the display interface.
[0048] According to the third aspect of an embodiment of the present application, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the interface display adaptation method described in the first aspect.
[0049] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the interface display adaptation method as described in the first aspect is implemented.
[0050] According to the interface display adaptation method provided by the embodiment of the present application, the first resolution of the display interface is first obtained, and when the resolution of the display interface changes to the second resolution, the display elements of the display interface are obtained, and the display elements are further adjusted using the second resolution to obtain the target display elements corresponding to the second resolution, and the target display elements are displayed on the display interface. When the embodiment of the present application detects that the resolution of the display interface has changed, the display elements are adjusted by the second resolution, and the display elements can be automatically adjusted, thereby enabling the display interface to be adaptive, thereby eliminating the need to design interfaces with different resolutions separately. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0052] Figure 1 A flowchart of a method for adapting an interface display according to an embodiment of the present application;
[0053] Figure 2 A schematic diagram of a display interface resolution change according to an embodiment of the present application;
[0054] Figure 3 A schematic diagram of a constraint condition in the illustrated embodiment;
[0055] Figure 4Another schematic diagram of display interface resolution change according to the present application;
[0056] Figure 5 is a structural block diagram of an interface display adaptation device according to an embodiment of the present application;
[0057] Figure 6 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.
[0059] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.
[0060] The embodiment of the present application provides an interface display adaptation method, which is applied to a terminal device with a display interface. The specific steps are as follows: Figure 1 As shown, including:
[0061] S101: A terminal device obtains a first resolution of a display interface.
[0062] In the embodiment of the present application, when the display interface of the terminal is working, the terminal device obtains the first resolution of the display interface, that is, the current resolution of the display interface. Specifically, the display interface of the embodiment of the present application includes the display interface of the vehicle, the display interface of the mobile phone, and the interface after the split screen.
[0063] S202: When the resolution of the display interface changes to a second resolution, the terminal device obtains display elements of the display interface.
[0064] In the embodiment of the present application, when the terminal device detects that the resolution of the display interface changes, that is, when the terminal device detects that the resolution of the display interface changes to the second resolution, the terminal device obtains the display element on the display interface.
[0065] In one example, the display elements of the embodiment of the present application may include buttons, text, text boxes, and lists, wherein the first resolution is different from the second resolution.
[0066] S103: The terminal device adjusts the display element according to the second resolution to obtain a target display element adapted to the second resolution.
[0067] In the embodiment of the present application, after acquiring the display element, the terminal device adjusts the display element using the second resolution to adapt to the second resolution, thereby obtaining a target display element adapted to the second resolution.
[0068] S104: The terminal device displays the target display element on the display interface.
[0069] In the embodiment of the present application, after the terminal device completes the adjustment of the display element, the terminal device displays the target display element on the display interface of the second resolution.
[0070] The interface display adaptation method provided in the embodiment of the present application first obtains the first resolution of the display interface, and when the resolution of the display interface changes to the second resolution, obtains the display elements of the display interface, further adjusts the display elements using the second resolution, obtains the target display elements corresponding to the second resolution, and displays the target display elements on the display interface. When the embodiment of the present application detects that the resolution of the display interface has changed, the display elements are adjusted using the second resolution, and the display elements can be automatically adjusted, thereby enabling the display interface to adapt, thereby eliminating the need to design interfaces with different resolutions separately.
[0071] Furthermore, the display element in the embodiment of the present application includes a button, and adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution may include the following steps:
[0072] S1031: When the terminal device determines that there are multiple buttons, the terminal device determines a resolution variation range according to a difference between the first resolution and the second resolution.
[0073] In an embodiment of the present application, when the terminal device determines that a display element is a button, the terminal device obtains the number of buttons. When the number of buttons is 1, the terminal device only adjusts the size of the buttons. When the number of buttons is multiple, the terminal device obtains a first resolution and a second resolution, and determines the resolution variation range of the display interface based on the difference between the first resolution and the second resolution.
[0074] S1032: When the terminal device determines that the resolution variation range belongs to the preset resolution variation range, the terminal device determines a first adjustment coefficient according to the first resolution and the second resolution.
[0075] In the embodiment of the present application, after obtaining the resolution variation range, the terminal device compares the resolution variation range with the preset resolution variation range, and when determining that the resolution variation range belongs to the preset resolution variation range, determines the first adjustment coefficient according to the first resolution and the second resolution. Specifically, the terminal device determines the first adjustment coefficient according to the ratio of the first resolution to the second resolution.
[0076] In an example, see Figure 2 As shown, it is a schematic diagram of the change of display interface resolution provided in an embodiment of the present application, wherein the first display interface (top) is a display interface of the first resolution, the second display interface (bottom) is a display interface of the second resolution, and the terminal device determines the first adjustment coefficient based on the first resolution and the second resolution.
[0077] S1033: The terminal device adjusts the sizes of the multiple buttons according to the first adjustment coefficient to obtain multiple target buttons adapted to the second resolution.
[0078] In the embodiment of the present application, after determining the first adjustment coefficient, the terminal device uses the first adjustment coefficient to adjust the sizes of the multiple buttons to obtain multiple target buttons adapted to the second resolution. Figure 2 As shown, the second display interface (below) is the adjusted button size, that is, multiple target buttons adapted to the second resolution.
[0079] In one example, when the terminal device adjusts the size of a button, it also obtains the constraints between multiple buttons at the first resolution, that is, the distance and position relationship between the multiple buttons. When the terminal device uses the first adjustment coefficient to adjust the size of the button, it does not adjust the distance between the buttons, that is, the distance between the multiple buttons adapted to the second resolution is the same as the distance and position relationship between the multiple buttons at the first resolution.
[0080] In an example, see Figure 3 As shown, it is a schematic diagram of the constraint conditions provided in an embodiment of the present application. Specifically, the constraint conditions may include a relative reference coordinate system, a vertical constraint, a left-aligned constraint, a left-aligned constraint, a left margin constraint, a vertical or horizontal constraint, and a text baseline alignment constraint.
[0081] When the terminal device completes adjusting the button size, it displays the adjusted button on the display interface. Figure 2 The second display interface shown in (below).
[0082] S1034: When the terminal device determines that the resolution variation range does not belong to the preset resolution variation range, the terminal device obtains the arrangement direction of the multiple buttons.
[0083] In an embodiment of the present application, the terminal device compares the resolution change range with the preset resolution change range. When it is determined that the resolution change range does not belong to the preset resolution change range, it is determined that the resolution change is too large, and the terminal device obtains the arrangement direction of multiple buttons under the first resolution.
[0084] In an example, see Figure 4As shown, another schematic diagram of the resolution change of the display interface is provided for an embodiment of the present application. When the terminal device determines that the resolution change range does not belong to the preset resolution change range, the terminal device obtains the arrangement direction of multiple buttons on the first display interface.
[0085] S1035: If the terminal device determines that the arrangement direction is vertical and the second resolution is greater than the first resolution, or the arrangement direction is horizontal and the second resolution is less than the first resolution, determine a first adjustment coefficient according to the first resolution and the second resolution.
[0086] In the embodiment of the present application, after obtaining the arrangement direction of the plurality of buttons, the terminal device determines the first adjustment coefficient according to the first resolution and the second resolution when determining that the arrangement direction is a vertical direction and the second resolution is greater than the first resolution, or the arrangement direction is a horizontal direction and the second resolution is less than the second resolution. Specifically, the terminal device determines the first adjustment coefficient according to the ratio of the first resolution to the second resolution.
[0087] S1036: The terminal device adjusts the sizes of the multiple buttons according to the first adjustment coefficient, and adjusts the arrangement direction of the multiple buttons to obtain multiple target buttons adapted to the second resolution.
[0088] In the embodiment of the present application, the terminal device simultaneously adjusts the size of the button and the arrangement direction of the multiple buttons to obtain multiple target buttons adapted to the second resolution. Figure 4 As shown, if the first resolution is the first display interface and the second resolution is the second display interface, the terminal device adjusts the horizontal arrangement to the vertical direction while adjusting the button size. If the first resolution is the second display interface and the second resolution is the first display interface, the terminal device adjusts the vertical arrangement to the horizontal direction while adjusting the button size.
[0089] The embodiment of the present application calculates the resolution variation range and compares the resolution variation range with the preset resolution variation range. When the resolution variation range falls within the preset resolution variation range, only the size of the button is adjusted. When the resolution variation range does not fall within the preset resolution variation range, the size and arrangement direction of the button are adjusted. The buttons can then be adaptively adjusted to ensure that the buttons remain clickable on screens with different resolutions.
[0090] Furthermore, in the embodiment of the present application, the display element includes text, and adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution may include the following steps:
[0091] S1037: The terminal device determines a target text size corresponding to the second resolution according to a correspondence between resolution and text size.
[0092] In the embodiment of the present application, when the terminal device determines that the display element is text, the terminal device obtains the correspondence between the resolution and the text size. Further, the terminal device determines the target text size corresponding to the second resolution based on the second resolution.
[0093] In one example, the unit of text size in the embodiment of the present application may be sp (scaled pixels). When implementing the method of this embodiment, a correspondence between different resolutions and text sizes may be set, and the correspondence may be pre-stored in the terminal device. The terminal device may directly read the above correspondence to obtain the target position size corresponding to the second resolution.
[0094] S1038: The terminal device adjusts the size of the text to the target text size to obtain text adapted to the second resolution.
[0095] In the embodiment of the present application, after determining the target text size, the terminal device adjusts the text size to the target text size to obtain text adapted to the second resolution, and displays the adjusted text on a display interface of the second resolution.
[0096] The embodiment of the present application can ensure that the text on the display interface at different resolutions can maintain an appropriate size by adjusting the text size.
[0097] Furthermore, the display element in the embodiment of the present application includes a text box, and adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution may include the following steps:
[0098] S1039: The terminal device determines a second adjustment coefficient based on the first resolution and the second resolution.
[0099] In the embodiment of the present application, the terminal device determines the second adjustment coefficient according to the first resolution and the second resolution. Specifically, the terminal device determines the second adjustment coefficient according to the ratio of the first resolution to the second resolution.
[0100] S1040: The terminal device adjusts the size of the text box according to the second adjustment coefficient to obtain a target text box.
[0101] In the embodiment of the present application, after the terminal device determines the second adjustment coefficient, the terminal device uses the second adjustment coefficient to adjust the size of the text box at the first resolution and obtains a target text box adapted to the second resolution.
[0102] S1041, the terminal device obtains the number of characters in a text line at a first resolution.
[0103] In the embodiment of the present application, after the terminal device completes adjusting the size of the text box, the terminal device obtains the number of text lines in the text box of the display interface corresponding to the first resolution. Specifically, the number of text lines in the text box can be obtained.
[0104] S1042: The terminal device determines the text line width according to the number of characters and the target text size.
[0105] In the embodiment of the present application, after obtaining the number of characters in a line and the target character size, the terminal device calculates the character width of the line using the number of characters in a line and the target character size. Specifically, the terminal device can obtain the first character width according to the number of characters in a first line and the target character width.
[0106] S1043: When the terminal device determines that the text line width is greater than the target text box width, the terminal device increases the number of lines of the target text box to obtain a text box suitable for the second resolution.
[0107] In an embodiment of the present application, after obtaining the line text width, the terminal device compares the line text width with the width of the target text box. When it is determined that the line text width is greater than the target text box width, the number of lines of the target text box is increased so that the first line of text is automatically wrapped to obtain a text box suitable for the second resolution.
[0108] The embodiment of the present application can ensure that the text in the text box will not overflow or cause layout confusion on the display interface of the second resolution by adjusting the size of the text box and automatically wrapping the text.
[0109] Furthermore, the display element in the embodiment of the present application further includes a list, and adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution may include the following steps:
[0110] S1044: The terminal device determines the target number of list columns corresponding to the second resolution based on the correspondence between the resolution and the number of list columns.
[0111] In the embodiment of the present application, when the terminal device determines that the display element is a list, the terminal device obtains the correspondence between the resolution and the number of list columns. Further, the terminal device determines the target number of list columns corresponding to the second resolution based on the second resolution.
[0112] In one example, the correspondence between the resolution and the number of columns in the list is pre-stored in the terminal device. For example, the correspondence between the resolution and the number of columns in the list may be that the number of columns in the list is 8 at the first resolution and 4 at the second resolution.
[0113] S1045, the terminal device sets the number of columns to the number of columns in the target list.
[0114] In the embodiment of the present application, after determining the number of columns in the target list, the terminal device sets the number of columns at the second resolution as the number of columns in the target list.
[0115] S1046: The terminal device determines a third adjustment coefficient based on the first resolution and the second resolution.
[0116] In the embodiment of the present application, the terminal device determines the third adjustment coefficient according to the first resolution and the second resolution. Specifically, the terminal device determines the third adjustment coefficient according to the ratio of the first resolution to the second resolution.
[0117] S1047: The terminal device adjusts the size of each column of the list according to the third adjustment coefficient to obtain a list suitable for the second resolution.
[0118] In the embodiment of the present application, after obtaining the third adjustment coefficient, the terminal device adjusts the size of each column in the list to obtain a list suitable for the second resolution.
[0119] S1048: The terminal device determines the total width of the list according to the number of columns in the target list and the list width of the second resolution.
[0120] In the embodiment of the present application, the terminal device obtains the list width of the list at the second resolution, and determines the total list width according to the number of target list columns and the list width at the second resolution.
[0121] S1049: When the total width of the list is greater than the interface width corresponding to the second resolution change, the terminal device scrolls and displays the list.
[0122] In the embodiment of the present application, the terminal device compares the total width of the list with the interface width corresponding to the second resolution variable. When the total width of the list is greater than the interface width corresponding to the second resolution variable, the list is scrolled and displayed on the display interface of the second resolution; when the total width of the list is less than or equal to the interface width corresponding to the second resolution variable, the list is displayed on the display interface of the second resolution.
[0123] The embodiment of the present application adjusts the list size through the third adjustment coefficient, so that the list can adapt to the display interface of the second resolution. Furthermore, when the total width of the list is larger than the interface width corresponding to the second resolution, the list is scrolled on the display interface of the second resolution, which can ensure that the list can display all the contents and improve the user experience.
[0124] Furthermore, the present application embodiment provides an interface display adaptation device, specifically as follows Figure 5 As shown, including:
[0125] A first acquisition module 501, used to acquire a first resolution of a display interface;
[0126] A second acquisition module 502, configured to acquire display elements of the display interface when the resolution of the display interface changes to a second resolution, wherein the first resolution is different from the second resolution;
[0127] An adjustment module 503, configured to adjust the display element according to the second resolution to obtain a target display element adapted to the second resolution;
[0128] The display module 504 is configured to display the target display element on a display interface.
[0129] The interface display adaptation device of this embodiment is used to implement the corresponding interface display adaptation methods in the aforementioned multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here. In addition, the functional implementation of each module in the interface display adaptation device of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be repeated here.
[0130] Reference Figure 6 , shows a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.
[0131] like Figure 6 As shown, the electronic device may include: a processor (processor) 602 , a communication interface (Communications Interface) 604 , a memory (memory) 506 , and a communication bus 608 .
[0132] in:
[0133] The processor 602 , the communication interface 604 , and the memory 606 communicate with each other via a communication bus 608 .
[0134] The communication interface 604 is used to communicate with other electronic devices or servers.
[0135] The processor 602 is used to execute the program 610, and specifically can execute the relevant steps in the above-mentioned interface display adaptation method embodiment.
[0136] Specifically, the program 610 may include program codes, which include computer operation instructions.
[0137] The processor 602 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0138] The memory 606 is used to store the program 610. The memory 606 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0139] The program 610 may be specifically configured to enable the processor 602 to perform the following operations:
[0140] In an optional implementation, the program 610 is also used to enable the processor 602 to implement each step in the program 610. The specific implementation can refer to the corresponding descriptions in the corresponding steps and units in the above-mentioned interface display adaptation method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, which will not be repeated here.
[0141] An embodiment of the present application also provides a computer program product, including computer instructions, which instruct a computing device to execute operations corresponding to any interface display adaptation method in the above-mentioned multiple method embodiments.
[0142] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0143] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor or programmable or dedicated hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the interface display adaptation method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the interface display adaptation method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the interface display adaptation method shown herein.
[0144] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.
[0145] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.
Claims
1. An interface display adaptation method, characterized in that: include: Get the first resolution of the display interface; When the resolution of the display interface changes to a second resolution, acquiring a display element of the display interface, wherein the first resolution is different from the second resolution; Adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution; The target display element is displayed on the display interface.
2. The method according to claim 1, characterized in that The display element includes a button; The step of adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution includes: When there are multiple buttons, determining a resolution variation range according to a difference between the first resolution and the second resolution; When the resolution variation range belongs to the preset resolution variation range, determining a first adjustment coefficient according to the first resolution and the second resolution; adjusting the sizes of the plurality of buttons according to the first adjustment coefficient to obtain a plurality of target buttons adapted to the second resolution, wherein the distance and position relationship between the plurality of target buttons at the second resolution are the same as the distance and position relationship between the plurality of buttons at the first resolution; The displaying the target display element on the display interface includes: The plurality of target buttons are displayed on the display interface.
3. The method according to claim 1, characterized in that: The display element includes a button; The step of adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution includes: When there are multiple buttons, determining a resolution variation range according to a difference between the first resolution and the second resolution; When the resolution variation range does not belong to the preset resolution variation range, obtaining arrangement directions of the plurality of buttons; If the arrangement direction is a vertical direction and the second resolution is greater than the first resolution, or if the arrangement direction is a horizontal direction and the second resolution is less than the second resolution, determining a first adjustment coefficient according to the first resolution and the second resolution; The sizes of the plurality of buttons are adjusted according to the first adjustment coefficient, and the arrangement directions of the plurality of buttons are adjusted to obtain a plurality of target buttons adapted to the second resolution.
4. The method according to claim 1, characterized in that: The display elements include text; The step of adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution includes: Determining a target text size corresponding to the second resolution according to a correspondence between resolution and text size; The size of the text is adjusted to the target text size to obtain the text adapted to the second resolution.
5. The method according to claim 4, characterized in that The display element includes a text box; The step of adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution includes: determining a second adjustment coefficient according to the first resolution and the second resolution; Adjust the size of the text box according to the second adjustment coefficient to obtain a target text box; Obtain the number of characters in a text line at the first resolution; Determine the text line width according to the number of characters and the target text size; When the text line width is greater than the target text box width, the number of lines of the target text box is increased to obtain the text box adapted to the second resolution.
6. The method according to claim 1, characterized in that The display element includes a list; The step of adjusting the display element according to the second resolution to obtain a target display element adapted to the second resolution includes: Determine the target number of list columns corresponding to the second resolution according to the corresponding relationship between the resolution and the number of list columns; Setting the number of columns to the number of target list columns; determining a third adjustment coefficient according to the first resolution and the second resolution; The size of each column of the list is adjusted according to the third adjustment coefficient to obtain the list suitable for the second resolution.
7. The method according to claim 6, characterized in that The method further comprises: Determine the total width of the list according to the number of columns of the target list and the list width of the second resolution; When the total width of the list is greater than the interface width corresponding to the second resolution variable, the list is scrolled and displayed.
8. An interface display adaptation device, characterized in that: include: A first acquisition module, used to acquire a first resolution of the display interface; A second acquisition module, configured to acquire display elements of the display interface when the resolution of the display interface changes to a second resolution, wherein the first resolution is different from the second resolution; an adjustment module, configured to adjust the display element according to the second resolution to obtain a target display element adapted to the second resolution; A display module is used to display the target display element on the display interface.
9. An electronic device, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the interface display adaptation method according to any one of claims 1-7.
10. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the interface display adaptation method according to any one of claims 1 to 7 is implemented.