Information processing method and device, electronic equipment, storage medium and program product
By obtaining the size information and size tolerance deviation of the string to be displayed, the text view relay is dynamically controlled, which solves the resource consumption problem caused by frequent updates of text views, improves the fluency of user interface display and reduces power consumption.
Patent Information
- Application Number
- CN202510466367.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-08
AI Technical Summary
In the prior art, the relayout caused by frequent update of text views consumes a large amount of system resources, affecting the fluency and power consumption of the user interface, and is particularly obvious in interfaces with a large number of views and complex layouts.
By obtaining the size information of the string to be displayed, and dynamically control the relaying of the text view based on the size information of the string to be displayed last time and the size tolerance of the text view, the text view is reduced to reduce the number of unnecessary relays.
It improves the effective utilization rate of system resources, improves the fluency of user interface display, and reduces power consumption, especially in complex interfaces.
Smart Images

Figure CN120276733A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and particularly to an information processing method, apparatus, electronic device, storage medium, and program product. Background Art
[0002] In the design of a user interface (UI), the text view plays a very important role. The text view can be used to display text, and is used very frequently, and will be frequently updated in many scenarios. For example, in a live broadcast scenario, relevant text contents such as the number of likes, the number of new messages, and the number of viewers on the user interface will be frequently updated, resulting in frequent updates of the text view.
[0003] The dynamic change of text content often requires an immediate adjustment of the size of the text view to maintain the beauty and functionality of the layout. In related technologies, once the text content is configured, it will trigger a re-layout of the text view, which may further cause the views in the entire view tree related to the text view to be re-layout. Summary of the Invention
[0004] According to some embodiments of the present disclosure, there is provided an information processing method, including: obtaining a to-be-displayed string corresponding to a currently configured text view in a user interface; determining size information of the to-be-displayed string; and determining whether to trigger a re-layout of the text view according to the size information of the to-be-displayed string, the size information of the string last displayed in the text view, and the size tolerance of the text view.
[0005] According to some other embodiments of the present disclosure, there is provided an information processing apparatus, including: an obtaining module configured to obtain a to-be-displayed string corresponding to a currently configured text view in a user interface; a size determining module configured to determine size information of the to-be-displayed string; and a layout determining module configured to determine whether to trigger a re-layout of the text view according to the size information of the to-be-displayed string, the size information of the string last displayed in the text view, and the size tolerance of the text view.
[0006] According to still some other embodiments of the present disclosure, there is provided an electronic device, including: a processor; and a memory coupled to the processor for storing instructions, which when executed by the processor, cause the processor to execute the information processing method according to any one of the embodiments of the present disclosure.
[0007] According to still some other embodiments of the present disclosure, there is provided a computer-readable storage medium having a computer program stored thereon, which when executed by a processor, executes the information processing method according to any one of the embodiments of the present disclosure.
[0008] Other features, aspects, and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. Description of the Drawings
[0009] Embodiments of the present disclosure will be described below with reference to the accompanying drawings. It should be understood that the drawings in the following description only relate to some embodiments of the present disclosure and do not constitute a limitation on the present disclosure. In the drawings:
[0010] Figure 1 A flowchart showing an information processing method according to some embodiments of the present disclosure;
[0011] Figure 2 A schematic diagram showing a display interface according to some embodiments of the present disclosure;
[0012] Figure 3 A flowchart showing an information processing method according to other embodiments of the present disclosure;
[0013] Figure 4 A schematic diagram showing the structure of an information processing apparatus according to some embodiments of the present disclosure;
[0014] Figure 5 A schematic diagram showing the structure of an electronic device according to some embodiments of the present disclosure;
[0015] Figure 6 A schematic diagram showing the structure of an electronic device according to other embodiments of the present disclosure. Detailed Embodiments
[0016] The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. It should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein.
[0017] It should be understood that the steps recited in the method embodiments of the present disclosure can be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard. Unless otherwise specifically stated, the relative arrangement of the steps set forth in these embodiments should be construed as merely exemplary and does not limit the scope of the present disclosure.
[0018] The term "comprising" and variations thereof used in the present disclosure mean an open term that includes at least the subsequent elements / features, but does not exclude other elements / features, that is, "including but not limited to". The term "based on" means "at least partially based on".
[0019] It should be noted that the modifications of "one" and "multiple" mentioned in this disclosure are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise clearly specified in the context, it should be understood as "one or more".
[0020] The embodiments of the present disclosure will be described in detail with reference to the accompanying drawings, but the present disclosure is not limited to these specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. In addition, in one or more embodiments, specific features, structures or characteristics can be combined by any suitable means that will be clear to those of ordinary skill in the art from the present disclosure.
[0021] In many application scenarios, the text in the text view will be frequently configured and updated. If the property value of the size setting of the text view is configured as an automatically adjustable property. Then once the text content is configured, it will trigger the re-layout of the text view, which in turn causes the views in the entire view tree related to the text view to be re-layout. For example, in the Android system, TextView is the UI component corresponding to the text view. The width, height, etc. of TextView are usually set to wrap_content, indicating that the size of TextView is automatically adjusted according to the text content. Then, as long as the setText (set text) method is called to configure the text content, regardless of whether the text content or size changes, the requestLayout (request re-layout) method will be triggered. And triggering the requestLayout method will cause the entire view tree where TextView is located to be measured and laid out.
[0022] For large-scale applications, the view hierarchy and the number are generally large. Under complex layouts, frequently triggering re-layout will consume a large amount of system resources, which in turn will have a greater impact on the smoothness and power consumption of the user interface display.
[0023] In view of this, the present disclosure provides an information processing method, which can obtain a string to be displayed corresponding to a currently configured text view in a user interface and automatically determine the size information of the string to be displayed. Furthermore, according to the size information of the string to be displayed, the size information of the string displayed last time in the text view, and the size tolerance of the text view, it is determined whether to trigger a relayout of the text view. This means that it is not necessary to trigger a relayout of the text view every time the content in the text view is configured. Instead, the relayout of the text view can be dynamically controlled based on the size information of the string and the size tolerance, which can reduce the number of relayouts and the consumption of system resources. Moreover, the measurement of the size of the string to be displayed is simple, and compared with the measurement of the text view and other related views after triggering a relayout, it also reduces the consumption of resources. The information processing method of the present disclosure can improve the effective utilization rate of system resources, improve the smoothness of the user interface display, and reduce power consumption. Especially for user interfaces with a large number of view hierarchies and complex layouts, the effect is more obvious.
[0024] The following will describe the information processing method of the present disclosure in conjunction with Figures 1 - 3 description.
[0025] Figure 1 is a flowchart of some embodiments of the information processing method of the present disclosure. As Figure 1 shown, the method of this embodiment includes steps S102 to S106.
[0026] In step S102, a string to be displayed corresponding to a currently configured text view in the user interface is obtained.
[0027] For example, the user interface is a live broadcast interface, an interactive live broadcast participated by multiple users (which can also be called live PK, live battle, etc., where the live streams of multiple users are combined and displayed, and the live pictures of multiple users can be displayed simultaneously in the live broadcast interface), an event display interface, etc., not limited to the examples given. The user interface may include one or more text views. For example, as Figure 2 shown, the live PK interface may include multiple text views corresponding to the like count 201, the viewer count 202, the timer 203, the score 204, the comment information 205, etc. For example, the event display interface may include a text view corresponding to the countdown of the event.
[0028] Different text views can correspond to different update periods or update times, etc. When the content (string) in the text view is updated, the string to be displayed corresponding to the text view can be configured to obtain the string to be displayed. The currently configured text view can be one or more. If there are multiple currently configured text views, the method of this embodiment can be executed for each text view. The string to be displayed can include one or more characters. The string to be displayed can include one or more types of characters, such as numbers, Chinese, English, emojis, etc., not limited to the examples given.
[0029] In step 104, determine the size information of the string to be displayed.
[0030] The size information of the string to be displayed includes at least one of the width and height of the string to be displayed. In some embodiments, determine whether the display direction of the string to be displayed and the attribute information of the characters change. When the display direction of the string to be displayed and the attribute information of the characters remain unchanged, determine the size information corresponding to the display direction of the string to be displayed. For example, if the display direction of the string to be displayed is horizontal, determine the width of the string to be displayed; if the display direction of the string to be displayed is vertical, determine the height of the string to be displayed. The attribute information of the characters includes font, font size, thickness, character spacing, etc. When the display direction of the string to be displayed or the attribute information of the characters changes, the width and height of the string to be displayed can be determined.
[0031] In step S106, determine whether to trigger a relayout of the text view according to the size information of the string to be displayed, the size information of the string last displayed in the text view, and the size tolerance of the text view.
[0032] The size information of the string last displayed corresponds to the size information of the string to be displayed and can be used to determine whether the size of the string in the text view has changed. The size tolerance of the text view is used to represent the allowable deviation between the currently determined size of the text view and the size of the text view automatically adjusted according to the size information of the string to be displayed. For example, when the attribute value of the size setting of the text view is wrap_content, the size of the text view automatically adjusted according to the size information of the string to be displayed can be determined.
[0033] The size tolerance can be configured according to actual needs. The higher the requirement for the size accuracy of the text view, the smaller the size tolerance can be set. Correspondingly, the probability of triggering a relayout may be higher. The size tolerance can include at least one of the width deviation and the height deviation.
[0034] The information processing method of the above embodiment can obtain the string to be displayed corresponding to the currently configured text view in the user interface and automatically determine the size information of the string to be displayed. Furthermore, based on the size information of the string to be displayed, the size information of the string displayed last time in the text view, and the size tolerance of the text view, it is determined whether to trigger a relayout of the text view. This means that it is not necessary to trigger a relayout of the text view every time the content in the text view is configured. Instead, the relayout of the text view can be dynamically controlled according to the size information of the string and the size tolerance of the text view, which can reduce the number of relayouts and the consumption of system resources. Moreover, the measurement of the size of the string to be displayed is simple, and compared with the measurement of the text view and other related views after triggering a relayout, it also reduces the consumption of resources. The information processing method of the above embodiment can improve the effective utilization rate of system resources, improve the smoothness of the user interface display, and reduce power consumption. Especially for user interfaces with a large number of view hierarchies and complex layouts, the effect is more obvious.
[0035] The following describes in detail the specific methods of each step of the above information processing method. First, how to obtain the string to be displayed is described below.
[0036] In some embodiments, in response to the text view calling the set text method to configure the string to be displayed, the string to be displayed is obtained from the set text method.
[0037] For example, for any TextView component, when the component calls the setText method to configure the string to be displayed, the string to be displayed can be obtained through the setText method.
[0038] After obtaining the string to be displayed, the string to be displayed can be recognized to determine whether the string to be displayed has changed relative to the string displayed last time (the characters or attribute information has changed); in response to the string to be displayed having changed relative to the string displayed last time, the size information of the string to be displayed is determined.
[0039] In some cases, the string to be displayed does not change relative to the string displayed last time. For example, in a live broadcast scenario, the same user sends the same message multiple times, that is, the content in the corresponding text view does not change. If the string to be displayed does not change relative to the string displayed last time (both the characters and attribute information remain unchanged), then it is not necessary to further measure the size of the string to be displayed, and it can be directly determined not to trigger a relayout of the text view, which further improves the judgment efficiency and saves system resources.
[0040] The following specifically describes how to determine the size information of the string to be displayed.
[0041] In some embodiments, the string to be displayed is segmented to obtain each character in the string to be displayed; according to the attribute information of each character, the size information of each character is determined; according to the size information of each character and the interval between every two characters, the size information of the string to be displayed is determined.
[0042] For example, the size information of the string to be displayed under a specified Paint setting can be determined. The Paint corresponds to the attribute information of the character. For example, in the Android system, the Paint object contains various attributes for string drawing, such as font, font size, style (bold, italic, etc.). The character interval, that is, the interval between every two characters, can also belong to the attribute information of the character or the string. The measureText method of Paint can be called to measure the width of each character, or the measureText method of Paint can be directly called to measure the width of the string to be displayed. When the measureText method is called with a character or a string as the parameter, the width occupied by this string when drawn according to the current Paint setting will be returned. For example, the getTextBounds method of paint can be called to determine the height of each character or the string to be displayed.
[0043] There are some fonts that are monospace fonts, that is, the widths of the same type of characters are equal. For example, the widths of Chinese characters are equal, and the widths of numeric characters are equal, etc. In this case, one or more character types corresponding to the string to be displayed, the number of characters of each character type, and the character sizes of each character type can be determined. According to the number and character sizes of the characters of each character type, the size information of the string to be displayed can be determined.
[0044] To further improve the efficiency of determining the size information of the string to be displayed, the size information of the characters can be stored in a cache. For example, for each character, check whether the size information of the character exists in the cache; in response to the size information of the character not existing in the cache, determine the size information of the character according to the attribute information of the character, and store the size information of the character in the cache; in response to the size information of the character existing in the cache, obtain the size information of the character from the cache.
[0045] For each character, first check whether the size information of the character exists in the cache. If not, further determine the size information of the character according to the attribute information of the character, and store the size information of the character in the cache for subsequent lookup, so as to improve the efficiency of determining the size information of the string to be displayed and save system resources.
[0046] In some embodiments, for each character, in response to a change in the attribute information of the character, the size information of the character in the cache is deleted, and based on the attribute information of the character, the size information of the character is re-determined, and the re-determined size information of the character is stored in the cache.
[0047] For each character, if the attribute information of the character changes, it is necessary to update the size information of the character in the cache to improve the accuracy of subsequently determining the size information of the string to be displayed.
[0048] The following specifically describes a method for determining whether to trigger a re-layout of the text view based on the size information of the string to be displayed, the size information of the string displayed last time in the text view, and the size tolerance of the text view.
[0049] In some embodiments, it is determined whether the size information of the string to be displayed has changed relative to the size information of the string displayed last time; in response to the size information of the string to be displayed changing relative to the size information of the string displayed last time, it is determined whether to trigger a re-layout of the text view based on the size tolerance of the text view.
[0050] The size information of the string displayed last time can be cached. By comparing the width of the string to be displayed and the width of the string displayed last time, and / or by comparing the height of the string to be displayed and the height of the string displayed last time, it can be determined whether the size information of the string to be displayed has changed relative to the size information of the string displayed last time. For example, when the text view is displayed horizontally and the attribute information of the string to be displayed has not changed relative to the string displayed last time, only the width of the string to be displayed and the width of the string displayed last time need to be compared. For example, when the text view is displayed vertically and the attribute information of the string to be displayed has not changed relative to the string displayed last time, only the height of the string to be displayed and the height of the string displayed last time need to be compared.
[0051] Different size tolerances can correspond to different triggering conditions for re-layout. When the size information of the string to be displayed has changed relative to the size information of the string displayed last time, it can be further determined whether to trigger a re-layout of the text view according to the triggering conditions corresponding to the size tolerance.
[0052] In some embodiments, in response to the size information of the string to be displayed not changing relative to the size information of the string displayed last time, it is determined not to trigger a re-layout of the text view.
[0053] Even if the string to be displayed changes relative to the previously displayed string, as long as the size information of the string to be displayed remains unchanged relative to the size information of the previously displayed string, there is no need to trigger a re-layout of the text view, thereby reducing the number of re-layouts, reducing the consumption of system resources, improving the utilization rate of system resources, enhancing the smoothness of the user interface display, and reducing power consumption.
[0054] If the attribute information of the string to be displayed remains unchanged relative to the previously displayed string, and the character sizes of the same character type are equal, it can be determined whether the character type corresponding to the string to be displayed is the same as the character type corresponding to the previously displayed string. If they are the same, it is determined whether the number of characters of each character type is the same. If they are the same, it is determined that the size information of the string to be displayed has not changed relative to the size information of the previously displayed string. Otherwise, it is determined that the size information of the string to be displayed has changed relative to the size information of the previously displayed string. This can reduce the measurement of character sizes.
[0055] The following specifically describes how to determine whether to trigger a re-layout of the text view based on the size tolerance of the text view.
[0056] In some embodiments, in response to the size tolerance being zero, it is determined to trigger a re-layout of the text view.
[0057] In the case where the size tolerance is zero, the triggering conditions may include the condition that the size information of the string to be displayed has changed relative to the size information of the previously displayed string. A size tolerance of zero means that the text view needs to precisely match the size of the string to be displayed. Therefore, as long as the size information of the string to be displayed changes relative to the size information of the previously displayed string, a re-layout of the text view is triggered. This can adapt to scenarios with high display accuracy for the UI, mainly reducing the number of times of triggering re-layouts when the size of the string remains unchanged.
[0058] In the case where the size tolerance is not zero, there can be multiple corresponding triggering conditions.
[0059] In some embodiments, in response to the size tolerance not being zero, based on the size information of the string to be displayed and the current size information of the text view, it is determined whether the text view can accommodate the string to be displayed; in response to the text view being unable to accommodate the string to be displayed, it is determined to trigger a re-layout of the text view.
[0060] A size tolerance not being zero means that there is a certain allowable error between the currently determined size of the text view and the size of the text view automatically adjusted according to the size information of the string to be displayed. In this case, the corresponding triggering conditions may include the condition that the text view is unable to accommodate the string to be displayed.
[0061] To determine whether a text view can accommodate a string to be displayed, it is possible to determine whether the current width of the text view is greater than or equal to the width of the string to be displayed, and / or determine whether the current height of the text view is greater than or equal to the height of the string to be displayed. For example, when the text view is displayed horizontally and the attribute information of the string to be displayed has not changed compared to the previously displayed string, it is possible to only determine whether the current width of the text view is greater than or equal to the width of the string to be displayed. If the current width of the text view is greater than or equal to the width of the string to be displayed and the current height of the text view is greater than or equal to the height of the string to be displayed, it is determined that the text view can accommodate the string to be displayed; otherwise, it cannot.
[0062] Since the size of the text view is slightly larger than the size of the string to be displayed, it is possible to determine whether the current width of the text view is greater than or equal to the sum of the width of the string to be displayed and the inner margin, and / or determine whether the current height of the text view is greater than or equal to the sum of the height of the string to be displayed and the inner margin. The inner margin in the width direction and the inner margin in the height direction can be different.
[0063] When the size tolerance deviation is not zero, considering whether the text view can accommodate the string to be displayed to determine whether to trigger a re-layout can reduce the number of re-layouts while ensuring that the string to be displayed can be accurately displayed and avoiding incomplete display.
[0064] In some embodiments, in response to the text view being able to accommodate the string to be displayed, determine the change value of the size information of the string to be displayed relative to the size information of the previously displayed string; in response to the change value being greater than the size tolerance deviation, determine to trigger a re-layout of the text view; in response to the change value being less than or equal to the size tolerance deviation, determine not to trigger a re-layout of the text view.
[0065] The trigger condition for re-layout can also include the condition that the change value is greater than the size tolerance deviation. The change value can be an absolute value. The change value can include at least one of the width change value and the height change value, and the size tolerance deviation can include at least one of the width tolerance deviation and the height tolerance deviation, depending on whether the size information of the string to be displayed and the size information of the previously displayed string contain width or height. For example, in response to the width change value being greater than the width tolerance deviation, or the height change value being greater than the height tolerance deviation, determine to trigger a re-layout of the text view; in response to the width change value being less than or equal to the width tolerance deviation and the height change value being less than or equal to the height tolerance deviation, determine not to trigger a re-layout of the text view.
[0066] Directly using the change value of the string to be displayed relative to the previously displayed string to determine whether the deviation of the text view is within the allowable size deviation can simplify the comparison process, thereby improving the efficiency of determining whether to trigger a re-layout.
[0067] The method of the above embodiment can be applied to scenarios where a certain error in the UI display accuracy is allowed. It can ensure the complete display of the string to be displayed within the allowable size deviation, and can more effectively reduce the number of times of triggering a re-layout, improve the effective utilization rate of system resources, improve the smoothness of the user interface display, and reduce power consumption.
[0068] In many cases, the sizes of the same type of characters do not differ much. For example, the widths of each of the numbers 0-9 do not differ much. In view of this characteristic, when the allowable size deviation is not zero, the following method can also be used to determine whether to trigger a re-layout of the text view.
[0069] In some embodiments, in response to the allowable size deviation not being zero, identify one or more character types corresponding to the string to be displayed and one or more character types of the previously displayed string; in response to one or more character types corresponding to the string to be displayed being partially or completely different from one or more character types of the previously displayed string, determine to trigger a re-layout of the text view.
[0070] The trigger condition for a re-layout can include the condition that the character types of the string to be displayed are different from those of the previously displayed string. For example, the character types corresponding to the string to be displayed are Chinese and numbers, and the character types corresponding to the previously displayed string are English and numbers. The size change of Chinese characters relative to English characters is relatively large. To avoid the incomplete display of the string to be displayed and improve the layout accuracy, it is determined to trigger a re-layout of the text view.
[0071] In some embodiments, in response to one or more character types corresponding to the string to be displayed being exactly the same as one or more character types of the previously displayed string; for each character type, determine whether the number of characters of this character type in the string to be displayed is the same as the number of characters of this character type in the previously displayed string; in response to the number of characters of the same character type in the string to be displayed and the previously displayed string being different, determine to trigger a re-layout of the text view; in response to the number of characters of the same character type in the string to be displayed and the previously displayed string being the same, determine not to trigger a re-layout of the text view.
[0072] The triggering conditions for re-layout may also include the condition that the number of characters of the same character type in the string to be displayed is different from that in the string displayed last time. If all the character types of the string to be displayed are the same as those of the string displayed last time, it can be determined whether the number of characters of each character type in the string to be displayed is the same as that in the string displayed last time. If they are the same, it is determined that the size change of the string to be displayed relative to the string displayed last time is not large, meeting the size tolerance deviation, and there is no need to trigger re-layout. Otherwise, re-layout needs to be triggered.
[0073] In the above embodiments, the method of the above embodiments can be applied to scenarios where a certain error in the UI display accuracy is allowed. Through the matching of character types and the number of characters, within the size tolerance deviation, the complete display of the string to be displayed is ensured, and the number of times of triggering re-layout can be more effectively reduced, the effective utilization rate of system resources can be improved, the fluency of the user interface display can be improved, and the power consumption can be reduced.
[0074] The sizes of characters of some character types may vary greatly. To further improve the layout accuracy, the above one or more character types may be one or more specific character types, and the maximum difference in the sizes of characters of each specific character type does not exceed a preset value. The maximum difference may include at least one of the width difference and the height difference, and the preset value may also include at least one of the width preset value and the height preset value. That is, in the above embodiments, if the string to be displayed and the string displayed last time only include specific character types, it can be determined whether to trigger the re-layout of the text view according to the method of the above embodiments.
[0075] If the string to be displayed and the string displayed last time also include other character types in addition to the specific character types, the following method can be used to determine whether to trigger the re-layout of the text view.
[0076] In some embodiments, in response to the size tolerance deviation not being zero, one or more specific character types that are the same in the string to be displayed and the string displayed last time are identified; in response to there being no one or more specific character types that are the same in the string to be displayed and the string displayed last time, it is determined to trigger the re-layout of the text view; in response to there being one or more specific character types that are the same in the string to be displayed and the string displayed last time, the first size information of the other characters in the string to be displayed except for the characters of one or more specific character types and the second size information of the other characters in the string displayed last time except for the characters of one or more specific character types are determined; in response to the first size information being different from the second size information, it is determined to trigger the re-layout of the text view.
[0077] The triggering conditions for re-layout can include the condition that there are no identical one or more specific character types in the string to be displayed and the string displayed last time, and the condition that the first size information is different from the second size information.
[0078] For example, both the string to be displayed and the string displayed last time include a specific character type such as numbers. Then, determine the first size information and the second size information of the characters other than the characters of the number type. It is also possible to directly determine whether the characters other than the specific character type in the string to be displayed and the string displayed last time are the same. If the other characters are the same, it is determined that the first size information and the second size information are the same. If the other characters are different, it can be determined whether the first size information and the second size information are the same.
[0079] In some embodiments, in response to the first size information being the same as the second size information, for each specific character type, determine whether the number of characters of this specific character type in the string to be displayed is the same as the number of characters of this specific character type in the string displayed last time; in response to the situation that there are different numbers of characters of the same specific character type in the string to be displayed and the string displayed last time, determine to trigger the re-layout of the text view; in response to the number of characters of the same specific character type in the string to be displayed and the string displayed last time being the same, determine not to trigger the re-layout of the text view.
[0080] The triggering conditions for re-layout include the condition that there are different numbers of characters of the same specific character type in the string to be displayed and the string displayed last time. If the first size information and the second size information are the same, and the numbers of characters of the same specific character type in the string to be displayed and the string displayed last time are the same, it means that the change of the text view is within the allowable deviation range of the size and there is no need to trigger the re-layout.
[0081] In response to the numbers of characters of the same specific character type in the string to be displayed and the string displayed last time being the same, it is also possible to determine the total number of characters of one or more specific character types. In response to the total number being less than or equal to the number threshold, determine not to trigger the re-layout of the text view. In response to the total number being greater than the number threshold, determine to trigger the re-layout of the text view. If the total number is too large, it may cause a relatively large change in the size of the string to be displayed and the string displayed last time, and the re-layout of the text view can be triggered. The allowable deviation of the size can be set as the product of the maximum difference in the sizes between the characters of the specific character type and the number threshold.
[0082] When setting the size of a text view, the product of the maximum size of characters of a specific character type and the number of characters of the specific character type can be determined, and the size of the text view can be set according to the sum of the size information of characters other than the characters of the specific character type and this product. After that, if only the characters of the specific character type change and the number of characters remains unchanged, the number of relayouts can be reduced.
[0083] For example, for the text view corresponding to the number of likes, if the string changes from "100 likes" to "999 likes", if a relayout needs to be triggered every time the value changes, 899 relayouts need to be triggered. If the above method is used, no relayout needs to be triggered.
[0084] The method of the above embodiment is applicable to scenarios where characters of a specific character type change frequently, and allows a certain error in the UI display accuracy. It can ensure the complete display of the string to be displayed within the allowable deviation of the size, and can more effectively reduce the number of triggered relayouts, improve the effective utilization rate of system resources, improve the smoothness of the user interface display, and reduce power consumption.
[0085] When the allowable deviation of the size is not zero, multiple methods for determining whether to trigger a relayout can be combined with each other. For example, if there are one or more specific character types that are the same in the string to be displayed and the string displayed last time, it can be determined whether the first size information and the second size information are the same. If the first size information and the second size information are different, the change value of the size information of the string to be displayed relative to the size information of the string displayed last time can be determined; in response to the change value being greater than the allowable deviation of the size, it is determined to trigger a relayout of the text view; in response to the change value being less than or equal to the allowable deviation of the size, it is determined not to trigger a relayout of the text view. If the first size information and the second size information are the same, for each specific character type, it is determined whether the number of characters of the specific character type in the string to be displayed is the same as the number of characters of the specific character type in the string displayed last time. In response to the situation where the number of characters of the same specific character type in the string to be displayed and the string displayed last time is different, it is determined to trigger a relayout of the text view; in response to the number of characters of the same specific character type in the string to be displayed and the string displayed last time being the same, it is determined not to trigger a relayout of the text view.
[0086] If it is determined to trigger a relayout of the text view, since the size information of the string to be displayed has been measured before, this size information can be used for relayout.
[0087] In some embodiments, in response to determining to trigger a relayout of the text view, the size information of the text view is redetermined according to the size information of the string to be displayed and the position parameters of the string to be displayed in the text view; the configured size information of the text view is updated to the redetermined size information; and a relayout of the text view is triggered according to the updated size information of the text view, wherein the attributes of the updated size information are configured as fixed values.
[0088] For example, the size information of the TextView can be set to the redetermined size information through LayoutParams and used as a fixed value. Subsequently, a relayout is performed according to the redetermined size information without the need for further measurement, saving system resources.
[0089] In some embodiments, for the text view, a relayout method is called, and the text view is relayout according to the updated size information of the set text view, the view tree related to the text view, and the layout parameters of other views in the view tree.
[0090] For example, by calling the requestLayout method, the text view and other views in the view tree can be relayout according to the updated size information of the set text view, the view tree related to the text view, and the layout parameters of other views in the view tree.
[0091] The following Figure 3 describes the information processing method of the present disclosure.
[0092] Figure 3 is a flowchart of some embodiments of the information processing method of the present disclosure. As Figure 3 shown, the method of this embodiment includes: steps S302 to S320.
[0093] In step S302, the string to be displayed corresponding to the currently configured text view in the user interface is obtained.
[0094] In step S304, the string to be displayed is recognized to determine whether the string to be displayed has changed compared to the previously displayed string. If not, step S320 is executed; otherwise, step S306 is executed.
[0095] In step S306, the string to be displayed is split to obtain each character in the string to be displayed.
[0096] In step S308, for each character, it is checked whether the size information of the character exists in the cache. If it exists, step S309 is executed; otherwise, step S310 is executed.
[0097] In step S309, obtain the size information of the character from the cache.
[0098] In step S310, determine the size information of the character according to the attribute information of the character, and store the size information of the character in the cache.
[0099] In step S312, determine the size information of the string to be displayed according to the size information of each character and the interval between every two characters.
[0100] In step S314, determine whether to trigger a re-layout of the text view according to the size information of the string to be displayed, the size information of the string displayed last time in the text view, and the size tolerance of the text view. If so, execute step S316; otherwise, execute step S320.
[0101] In step S316, re-determine the size information of the text view according to the size information of the string to be displayed, and update the configured size information of the text view to the re-determined size information.
[0102] In step S318, call the re-layout method to perform a re-layout.
[0103] In step S320, display the string to be displayed.
[0104] The super.setText method can be called to display the string to be displayed. The super.setText method for the system update process can refer to the prior art and will not be elaborated here.
[0105] The information processing method of the present disclosure can be executed by the client. By taking over the measurement process of the system and determining whether to trigger a re-layout, it is possible to avoid the need for re-measurement and re-layout every time after updating the text. When applied in a live broadcast scenario, since the number of re-layouts is greatly reduced, the live broadcast frame rate can be effectively increased, the frame drop rate can be reduced, the power consumption can be reduced, the device heating can be reduced, and the smoothness of the screen display can be improved.
[0106] The present disclosure also provides an information processing device, which will be described below in conjunction with Figure 4 for description.
[0107] Figure 4 is a structural diagram of some embodiments of the information processing device of the present disclosure. As Figure 4 shown, the information processing device 40 of this embodiment includes: an acquisition module 410, a size determination module 420, and a layout determination module 430.
[0108] The acquisition module 410 is configured to acquire the string to be displayed corresponding to the text view currently configured in the user interface.
[0109] The size determination module 420 is configured to determine the size information of the string to be displayed.
[0110] The layout determination module 430 is configured to determine whether to trigger a re-layout of the text view based on the size information of the string to be displayed, the size information of the string last displayed in the text view, and the size tolerance of the text view.
[0111] In some embodiments, the layout determination module 430 is configured to determine whether the size information of the string to be displayed has changed relative to the size information of the string last displayed; in response to the size information of the string to be displayed having changed relative to the size information of the string last displayed, determine whether to trigger a re-layout of the text view based on the size tolerance of the text view.
[0112] In some embodiments, the layout determination module 430 is configured to determine to trigger a re-layout of the text view in response to the size tolerance being zero.
[0113] In some embodiments, the layout determination module 430 is configured to, in response to the size tolerance not being zero, determine whether the text view can accommodate the string to be displayed based on the size information of the string to be displayed and the current size information of the text view; in response to the text view being unable to accommodate the string to be displayed, determine to trigger a re-layout of the text view.
[0114] In some embodiments, the layout determination module 430 is configured to, in response to the text view being able to accommodate the string to be displayed, determine the change value of the size information of the string to be displayed relative to the size information of the string last displayed; in response to the change value being greater than the size tolerance, determine to trigger a re-layout of the text view; in response to the change value being less than or equal to the size tolerance, determine not to trigger a re-layout of the text view.
[0115] In some embodiments, the layout determination module 430 is configured to, in response to the size tolerance not being zero, identify one or more specific character types that are the same in the string to be displayed and the string last displayed; in response to there being no one or more specific character types that are the same in the string to be displayed and the string last displayed, determine to trigger a re-layout of the text view; in response to there being one or more specific character types that are the same in the string to be displayed and the string last displayed, determine the first size information of the characters other than the one or more specific character types in the string to be displayed and the second size information of the characters other than the one or more specific character types in the string last displayed; in response to the first size information being different from the second size information, determine to trigger a re-layout of the text view.
[0116] In some embodiments, the layout determination module 430 is further configured to, in response to the first dimension information being the same as the second dimension information, determine, for each specific character type, whether the number of characters of the specific character type in the string to be displayed is the same as the number of characters of the specific character type in the previously displayed string; in response to there being a case where the number of characters of the same specific character type in the string to be displayed is different from the number of characters of the same specific character type in the previously displayed string, determine to trigger a relayout of the text view; and in response to the number of characters of the same specific character type in the string to be displayed being the same as the number of characters of the same specific character type in the previously displayed string, determine not to trigger a relayout of the text view.
[0117] In some embodiments, the layout determination module 430 is further configured to, in response to the dimension information of the string to be displayed not changing with respect to the dimension information of the previously displayed string, determine not to trigger a relayout of the text view.
[0118] In some embodiments, the dimension determination module 420 is configured to identify the string to be displayed and determine whether the string to be displayed has changed with respect to the previously displayed string; in response to the string to be displayed having changed with respect to the previously displayed string, determine the dimension information of the string to be displayed.
[0119] In some embodiments, the dimension determination module 420 is configured to split the string to be displayed to obtain each character in the string to be displayed; determine the dimension information of each character according to the attribute information of each character; and determine the dimension information of the string to be displayed according to the dimension information of each character and the interval between every two characters.
[0120] In some embodiments, the dimension determination module 420 is configured to, for each character, look up in the cache whether there is dimension information of the character; in response to there being no dimension information of the character in the cache, determine the dimension information of the character according to the attribute information of the character and store the dimension information of the character in the cache; and in response to there being dimension information of the character in the cache, obtain the dimension information of the character from the cache.
[0121] In some embodiments, the layout determination module 430 is further configured to, in response to determining to trigger a relayout of the text view, re-determine the dimension information of the text view according to the dimension information of the string to be displayed and the position parameters of the string to be displayed in the text view; update the configured dimension information of the text view to the re-determined dimension information; and trigger a relayout of the text view according to the updated dimension information of the text view, wherein the attribute of the updated dimension information is configured as a fixed value.
[0122] In some embodiments, the layout determination module 430 is further configured to, for a text view, call a relayout method to relayout the text view according to the updated size information of the set text view, the view tree related to the text view, and the layout parameters of other views in the view tree.
[0123] In some embodiments, the user interface includes a live broadcast interface, and the live broadcast interface includes one or more text views.
[0124] In some embodiments, the acquisition module 410 is configured to, in response to a text view, call a set text method to configure a string to be displayed, and obtain the string to be displayed from the set text method.
[0125] Figure 5 A block diagram of an electronic device according to some embodiments of the present disclosure is shown.
[0126] The memory 51 is used to store one or more computer-readable instructions. The memory 51 may include any combination of various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory, including but not limited to random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), read-only memory (ROM), and flash memory. The memory 51 may store, for example, an operating system, application programs, a boot loader (BootLoader), a database, and other programs, and may also store various application programs and various data.
[0127] The processor 52 is used to run computer-readable instructions to implement the information processing method described in any of the foregoing embodiments. For the specific implementation of each step of the method, reference may be made to the foregoing embodiments, and repeated parts will not be elaborated here.
[0128] The processor 52 may be configured to execute Figure 1 、 Figure 3 The steps in. The processor 52 may be embodied as various processing devices, such as a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The central processing unit (CPU) may be of the X86 or ARM architecture, etc.
[0129] The processor 52 and the memory 51 may communicate with each other directly or indirectly. For example, the processor 52 and the memory 51 may communicate through a network. The network may include a wireless network, a wired network, and / or any combination of a wireless network and a wired network. The processor 52 and the memory 51 may also communicate with each other through a system bus, and the present disclosure does not limit this.
[0130] It should be noted that Figure 5 The components of the illustrated electronic device 5 are merely exemplary and not restrictive. According to actual application requirements, the electronic device 5 may also have other components. The processor 52 can control other components in the electronic device 5 to perform desired functions.
[0131] The electronic device 5 can be implemented in software, firmware, and / or hardware, and can be integrated in a device installed with relevant application programs.
[0132] Figure 6 A block diagram of an electronic device according to other embodiments of the present disclosure is shown.
[0133] Figure 6 The illustrated electronic device 6 can be a computer system with a dedicated hardware structure and can perform corresponding functions when installed with relevant application programs.
[0134] The electronic device includes, but is not limited to, mobile terminals such as smart phones, laptop computers, personal digital assistants (PDAs), tablet personal computers (Tablet PCs), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable devices, etc., and fixed terminals such as digital TVs, desktop computers, etc.
[0135] As Figure 6 shown, the central processing unit (CPU) 61 executes various processes according to the programs stored in the read-only memory (ROM) 62 or the programs loaded from the storage section 68 into the random access memory (RAM) 63. In the RAM 63, data required when the CPU 61 executes various processes, etc. is stored as needed. The central processing unit is merely exemplary, and it can also be other types of processors, such as the various processors described above. The ROM 62, RAM 63, and storage section 68 can be various forms of computer-readable storage media. It should be noted that although Figure 6 the ROM 62, RAM 63, and storage section 68 are shown separately, one or more of them can be combined, or located in the same or different memories or storage modules.
[0136] The CPU 61, ROM 62, and RAM 63 are connected to each other via a bus 64. The input / output interface 65 is also connected to the bus 64.
[0137] The following components are connected to the input / output interface 65: an input section 66 such as a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output section 67 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage section 68 including a hard disk, a magnetic tape, etc.; and a communication section 69 including a network interface card such as a LAN card, a modem, etc. The communication section 69 allows communication processing to be performed via a network such as the Internet. It is easily understandable that although Figure 6 the parts shown in the electronic device 6 communicate through the bus 64, they may also communicate through a network or other means, where the network may include a wireless network, a wired network, and / or any combination of a wireless network and a wired network.
[0138] As needed, a driver 610 is also connected to the input / output interface 65. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is installed on the driver 610 as needed, so that a computer program read therefrom is installed in the storage section 68 as needed.
[0139] In the case where the above series of processes are implemented by software, a program constituting the software can be installed from a network such as the Internet or a storage medium such as the removable medium 611.
[0140] According to an embodiment of the present disclosure, the processes described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product that, when the computer program product runs on a computer, causes the computer to implement the method described in any one of the foregoing embodiments. The computer program product includes computer instructions carried on a computer-readable medium, including program codes for executing the method shown in the flowchart. In such an embodiment, the computer instructions can be downloaded and installed from a network through the communication section 69, or installed from the storage section 68, or installed from the ROM 62. When the computer program is executed by the CPU 61, the method of the embodiment of the present disclosure is executed.
[0141] It should be noted that in the context of the present disclosure, a computer-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
[0142] A computer-readable medium may be a computer-readable storage medium, or a computer-readable signal medium, or any combination of the above two.
[0143] Computer-readable storage media include, but are not limited to, systems, devices, or components of electricity, magnetism, optics, electromagnetic, infrared, or semiconductors, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present disclosure, a computer-readable storage media may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. Computer instructions are stored on the computer-readable storage media, and when executed by a processor, implement the method described in any of the foregoing embodiments.
[0144] A computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or component. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0145] The above computer-readable media may be included in the above electronic devices; or may exist separately without being assembled into the electronic devices.
[0146] In some embodiments, a computer program is also provided, including: instructions that, when executed by a processor, cause the processor to execute the method described in any of the foregoing embodiments. For example, the instructions may be embodied as computer program code.
[0147] In embodiments of the present disclosure, computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The foregoing programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partially on the user's computer, execute as a stand-alone software package, execute partially on the user's computer and partially on a remote computer, or execute entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0148] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a portion of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0149] The functions described above may be performed, at least in part, by one or more hardware logic components. For example, by way of non-limitation, exemplary hardware logic components that may be used include: field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), system on a chip (SOC), complex programmable logic devices (CPLD), and the like.
[0150] Although some specific embodiments of the present disclosure have been described in detail by way of example, those skilled in the art should understand that the above examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Those skilled in the art should understand that the above embodiments may be modified without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims
1. An information processing method, comprising: Obtaining a string to be displayed corresponding to a currently configured text view in a user interface; Determining size information of the string to be displayed; Determining whether to trigger a re-layout of the text view according to the size information of the string to be displayed, the size information of the string displayed last time in the text view, and the size tolerance of the text view.
2. The information processing method according to claim 1, wherein, The determining whether to trigger a re-layout of the text view according to the size information of the string to be displayed, the size information of the string displayed last time in the text view, and the size tolerance of the text view includes: Determining whether the size information of the string to be displayed has changed relative to the size information of the string displayed last time; In response to the size information of the string to be displayed changing relative to the size information of the string displayed last time, determining whether to trigger a re-layout of the text view according to the size tolerance of the text view.
3. The information processing method according to claim 2, wherein, The determining whether to trigger a re-layout of the text view according to the size tolerance of the text view includes: In response to the size tolerance being zero, determining to trigger a re-layout of the text view.
4. The information processing method according to claim 2, wherein, The determining whether to trigger a re-layout of the text view according to the size tolerance of the text view includes: In response to the size tolerance not being zero, determining whether the text view can accommodate the string to be displayed according to the size information of the string to be displayed and the current size information of the text view; In response to the text view being unable to accommodate the string to be displayed, determining to trigger a re-layout of the text view.
5. The information processing method according to claim 4, wherein, The determining whether to trigger a re-layout of the text view according to the size tolerance of the text view includes: In response to the text view being able to accommodate the string to be displayed, determining a change value of the size information of the string to be displayed relative to the size information of the string displayed last time; In response to the change value being greater than the size tolerance, determining to trigger a re-layout of the text view; In response to the change value being less than or equal to the size tolerance, determining not to trigger a re-layout of the text view.
6. The information processing method according to claim 2, wherein, The determining whether to trigger a re-layout of the text view according to the size tolerance of the text view includes: In response to the size tolerance not being zero, identifying one or more specific character types that are the same in the string to be displayed and the string displayed last time; In response to there being no one or more specific character types that are the same in the string to be displayed and the string displayed last time, determining to trigger a re-layout of the text view; In response to there being one or more specific character types that are the same in the string to be displayed and the string displayed last time, determining first size information of other characters in the string to be displayed except for the characters of the one or more specific character types, and second size information of other characters in the string displayed last time except for the characters of the one or more specific character types; In response to the first size information being different from the second size information, it is determined to trigger a relayout of the text view.
7. The information processing method according to claim 6, wherein, The determining whether to trigger a relayout of the text view according to the size tolerance of the text view further includes: In response to the first size information being the same as the second size information, for each specific character type, it is determined whether the number of characters of the specific character type in the string to be displayed is the same as the number of characters of the specific character type in the previously displayed string; In response to there being a situation where the number of characters of the same specific character type in the string to be displayed is different from the number of characters of the same specific character type in the previously displayed string, it is determined to trigger a relayout of the text view; In response to the number of characters of the same specific character type in the string to be displayed being the same as the number of characters of the same specific character type in the previously displayed string, it is determined not to trigger a relayout of the text view.
8. The information processing method according to claim 2, wherein The determining whether to trigger a relayout of the text view according to the size information of the string to be displayed, the size information of the string previously displayed in the text view, and the size tolerance of the text view further includes: In response to the size information of the string to be displayed not changing relative to the size information of the previously displayed string, it is determined not to trigger a relayout of the text view.
9. The information processing method according to claim 1, wherein The determining the size information of the string to be displayed includes: Identifying the string to be displayed to determine whether the string to be displayed has changed relative to the previously displayed string; In response to the string to be displayed having changed relative to the previously displayed string, determining the size information of the string to be displayed.
10. The information processing method according to claim 1, wherein, The determining the size information of the string to be displayed includes: Splitting the string to be displayed to obtain each character in the string to be displayed; Determining the size information of each character according to the attribute information of each character; Determining the size information of the string to be displayed according to the size information of each character and the interval between every two characters.
11. The information processing method according to claim 10, wherein, The determining the size information of each character according to the attribute information of each character includes: For each character, looking up in the cache whether there is size information of the character; In response to the size information of the character not existing in the cache, determining the size information of the character according to the attribute information of the character, and storing the size information of the character in the cache; In response to the size information of the character existing in the cache, obtaining the size information of the character from the cache.
12. The information processing method according to any one of claims 1-11 further includes: In response to determining to trigger a relayout of the text view, re-determining the size information of the text view according to the size information of the string to be displayed and the position parameters of the string to be displayed in the text view; Updating the configured size information of the text view to the re-determined size information; Triggering a relayout of the text view according to the updated size information of the text view, wherein the attribute of the updated size information is configured as a fixed value.
13. The information processing method according to claim 12, wherein, The triggering of the relayout of the text view based on the updated size information after the update of the text view includes: For the text view, call the relayout method, and based on the updated size information of the text view set, the view tree related to the text view, and the layout parameters of other views in the view tree, perform a relayout on the text view.
14. The information processing method according to any one of claims 1-11, wherein, The user interface includes a live broadcast interface, and the live broadcast interface includes one or more text views. The obtaining of the string to be displayed corresponding to the text view currently configured in the user interface includes: In response to the text view calling the set text method to configure the string to be displayed, obtain the string to be displayed from the set text method.
15. An information processing device, comprising: An obtaining module, configured to obtain the string to be displayed corresponding to the text view currently configured in the user interface; A size determination module, configured to determine the size information of the string to be displayed; A layout determination module, configured to determine whether to trigger a relayout of the text view based on the size information of the string to be displayed, the size information of the string last displayed in the text view, and the size tolerance of the text view.
16. An electronic device, comprising: A processor; And A memory coupled to the processor for storing instructions, which when executed by the processor cause the processor to execute the information processing method according to any one of claims 1 to 14.
17. A computer-readable storage medium having a computer program stored thereon, wherein, When the program is executed by the processor, it implements the information processing method according to any one of claims 1 to 14.
18. A computer program product, comprising instructions, which when executed by a processor cause the processor to execute the information processing method according to any one of claims 1 to 14.