CN110806824A - Text display method, component, electronic device and readable storage medium - Google Patents

Text display method, component, electronic device and readable storage medium Download PDF

Info

Publication number
CN110806824A
CN110806824A CN201810887007.8A CN201810887007A CN110806824A CN 110806824 A CN110806824 A CN 110806824A CN 201810887007 A CN201810887007 A CN 201810887007A CN 110806824 A CN110806824 A CN 110806824A
Authority
CN
China
Prior art keywords
display
text
window
display window
text display
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810887007.8A
Other languages
Chinese (zh)
Inventor
涂勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Guangzhou Uc Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Uc Network Technology Co ltd filed Critical Guangzhou Uc Network Technology Co ltd
Priority to CN201810887007.8A priority Critical patent/CN110806824A/en
Publication of CN110806824A publication Critical patent/CN110806824A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04886Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures by partitioning the display area of the touch-screen or the surface of the digitising tablet into independently controllable areas, e.g. virtual keyboards or menus

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

According to the text display method, the text display assembly, the electronic equipment and the readable storage medium, the display switching operation triggered by a user on the first text display window displayed on the display interface is received; the first display window is used for displaying a text to be displayed with a preset line number according to a preset display layout; according to the display position of the first text display window on the display interface, the first text display window is extended along the preset direction corresponding to the display position, so that a second text display window is formed and displayed on the display interface, wherein the second text display window is used for displaying all texts to be displayed, and therefore the intelligent display method is provided, the display flexibility is improved, and particularly good display effect and user experience are provided for the display of large text information.

Description

Text display method, component, electronic device and readable storage medium
Technical Field
The present invention relates to computer technologies, and in particular, to a text display method, a text display assembly, an electronic device, and a readable storage medium.
Background
With the popularization of mobile terminals, it is becoming a daily life of people to acquire text information on the mobile terminals.
Generally, mobile terminals tend to utilize a text display component, such as TextView, to provide a display function of text information to a user. In the existing process of displaying text information, the text display component can only display the text information according to the display layout preset by a user.
However, in many cases, the size of the text information and the limitation of the display area of the mobile terminal are limited, and when the mobile terminal displays the text information by using the text display component, the actual situation of the text information to be displayed cannot be considered, so that the preset display layout cannot be reasonably adapted to the text information, and particularly for the display of a text with a large text information size, the display effect is poor, and the reading experience of the user on the text information is poor.
Disclosure of Invention
The invention provides a text display method, a text display assembly, an electronic device and a readable storage medium, aiming at the problem that the display effect of the existing text display assembly for text information is poor due to the fact that the text information is displayed according to the display layout preset by a user.
In one aspect, the present invention provides a text display method, including:
receiving display switching operation triggered by a user on a first text display window displayed on a display interface; the first display window is used for displaying a text to be displayed with a preset line number according to a preset display layout;
according to the display position of the first text display window on a display interface, extending the first text display window along a preset direction corresponding to the display position so as to form and display a second text display window on the display interface, wherein the second text display window is used for displaying all texts to be displayed.
In an optional implementation manner, after receiving a display switching operation triggered by a user on a first text display window displayed on a display interface, the method further includes:
judging whether the first text display window displays all texts to be displayed or not;
if so, keeping displaying the first text display window on the display interface;
and if not, executing a step of extending the first text display window along a preset direction corresponding to the display position according to the display position of the first text display window on the display interface so as to form and display a second text display window on the display interface.
In an optional implementation manner, the extending the first text display window along a preset direction corresponding to a display position of the first text display window on a display interface according to the display position of the first text display window on the display interface to form and display a second text display window on the display interface includes:
when the display position is located in an upper preset area of the display interface, the first text display window is expanded towards the lower part of the display interface along the vertical direction so as to form and display a second text display window on the display interface, and the position of an upper reference line of the second text display window is the same as that of the upper reference line of the first text display window.
In an optional implementation manner, the extending the first text display window along a preset direction corresponding to a display position of the first text display window on a display interface according to the display position of the first text display window on the display interface to form and display a second text display window on the display interface includes:
when the display position is located in a lower preset area of the display interface, the first text display window is expanded towards the upper part of the display interface along the vertical direction so as to form and display a second text display window on the display interface, and the position of a lower reference line of the second text display window is the same as that of the lower reference line of the first text display window.
In an optional implementation manner, the extending the first text display window along a preset direction corresponding to the display position to form and display a second text display window on the display interface includes:
determining the maximum rendering height of the text to be displayed;
determining the window height of a second text display window according to the maximum rendering height, the distance between the preset text to be displayed and the upper reference line and the distance between the text to be displayed and the lower reference line;
determining an extension distance according to the preset window height of the first window and the preset window height of the second text display window;
and extending the first text display window along a preset direction corresponding to the display position by the extending distance so as to form and display a second text display window on the display interface.
In an optional implementation manner, the text display method further includes:
and the first text display window extends along a preset direction corresponding to the display position according to a preset extension speed, and a second text display window is formed and displayed on the display interface.
In an optional implementation manner, before the receiving a display switching operation triggered by a user on a first text display window displayed on a display interface, the method further includes:
receiving display layout configuration of a first display window, so that the first window can display a text to be displayed with a preset line number according to the display layout configuration; wherein the display layout configuration includes a number of displayable lines of text.
In another aspect, the present invention provides a text display assembly, comprising:
the triggering unit is used for receiving display switching operation triggered by a user on a first text display window displayed on a display interface; the first display window is used for displaying a text to be displayed with a preset line number according to a preset display layout;
the display unit is used for extending the first text display window along a preset direction corresponding to the display position according to the display position of the first text display window on the display interface so as to form and display a second text display window on the display interface, wherein the second text display window is used for displaying all texts to be displayed.
In one optional implementation, the text display assembly further comprises: a judgment unit;
the judging unit is used for judging whether the first text display window displays all texts to be displayed or not after the triggering unit receives display switching operation triggered by a user on the first text display window displayed on a display interface; if so, the display unit keeps displaying the first text display window on the display interface; if not, the display unit executes a step of extending the first text display window along a preset direction corresponding to the display position according to the display position of the first text display window on the display interface so as to form and display a second text display window on the display interface.
In one optional implementation, the display unit is specifically configured to:
when the display position is located in an upper preset area of the display interface, the first text display window is expanded towards the lower part of the display interface along the vertical direction so as to form and display a second text display window on the display interface, and the position of an upper reference line of the second text display window is the same as that of the upper reference line of the first text display window.
In one optional implementation, the display unit is specifically configured to:
when the display position is located in a lower preset area of the display interface, the first text display window is expanded towards the upper part of the display interface along the vertical direction so as to form and display a second text display window on the display interface, and the position of a lower reference line of the second text display window is the same as that of the lower reference line of the first text display window.
In one optional implementation, the display unit is specifically configured to:
determining the maximum rendering height of the text to be displayed;
determining the window height of a second text display window according to the maximum rendering height, the distance between the preset text to be displayed and the upper reference line and the distance between the text to be displayed and the lower reference line;
determining an extension distance according to the preset window height of the first window and the preset window height of the second text display window;
and extending the first text display window along a preset direction corresponding to the display position by the extending distance so as to form and display a second text display window on the display interface.
In an optional embodiment, the display unit is further configured to:
and extending the first text display window along a preset direction corresponding to the display position according to a preset extending speed, and forming and displaying a second text display window on the display interface.
In an optional implementation manner, the triggering unit is further configured to receive a display layout configuration of a first display window before receiving a display switching operation triggered by a user on the first text display window displayed on the display interface, so that the display unit displays a text to be displayed with a preset number of lines in the first display window according to the display layout configuration; wherein the display layout configuration includes a realistic number of lines of text.
In yet another aspect, the present invention provides an electronic device, comprising: a display unit, a memory, a processor connected to the memory, and a computer program stored on the memory and executable on the processor,
the display unit is used for providing a display interface;
the processor, when executing the computer program, performs the method of any of the preceding claims.
In a final aspect, the invention provides a readable storage medium comprising a program which, when run on an electronic device, causes the electronic device to perform the method of any of the preceding claims.
According to the text display method, the text display assembly, the electronic equipment and the readable storage medium, the display switching operation triggered by a user on the first text display window displayed on the display interface is received; the first display window is used for displaying a text to be displayed with a preset line number according to a preset display layout; according to the display position of the first text display window on the display interface, the first text display window is extended along the preset direction corresponding to the display position, so that a second text display window is formed and displayed on the display interface, wherein the second text display window is used for displaying all texts to be displayed, and therefore the intelligent display method is provided, the display flexibility is improved, and particularly good display effect and user experience are provided for the display of large text information.
Drawings
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Fig. 1 is a schematic flowchart of a text display method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a text display method according to a second embodiment of the present invention;
fig. 3 is a schematic diagram of a display window transformation according to a second embodiment of the present invention;
FIG. 4 is a diagram illustrating another display window transformation according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a text display module according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention.
With the popularization of mobile terminals, it is becoming a daily life of people to acquire text information on the mobile terminals.
Generally, mobile terminals tend to utilize a text display component, such as TextView, to provide a display function of text information to a user. In the existing process of displaying text information, the text display component can only display the text information according to the display layout preset by a user.
However, in many cases, the size of the text information and the limitation of the display area of the mobile terminal are limited, and when the mobile terminal displays the text information by using the text display component, the actual situation of the text information to be displayed cannot be considered, so that the preset display layout cannot be reasonably adapted to the text information, and particularly for the display of a text with a large text information size, the display effect is poor, and the reading experience of the user on the text information is poor.
The invention provides a text display method, a text display assembly, an electronic device and a readable storage medium, aiming at the problem that the display effect of the existing text display assembly for text information is poor due to the fact that the text information is displayed according to the display layout preset by a user.
Fig. 1 is a schematic flowchart of a text display method according to an embodiment of the present invention.
As shown in fig. 1, the text display method includes:
step 101, receiving a display switching operation triggered by a user on a first text display window displayed on a display interface; the first display window is used for displaying the text to be displayed with the preset line number according to the preset display layout.
Step 102, according to a display position of the first text display window on a display interface, extending the first text display window along a preset direction corresponding to the display position to form and display a second text display window on the display interface, wherein the second text display window is used for displaying all texts to be displayed.
It should be noted that an execution main body of the text display method provided in the first embodiment of the present invention is a text display component, where the text display component may be a plug-in or a control installed on an electronic device, and the electronic device may be an electronic product installed with each operating system. The electronic product can be a mobile terminal, a tablet computer, a portable intelligent device and the like. The display interface refers to an operation interface, an operation state or an operation interface of the electronic device, which is displayed to a user by a display unit of the electronic device, and the display unit refers to a display screen, a display and a display area on the electronic device. In addition, the program loaded in the text display component can be written by C/C + +, Java, Shell or Python.
In this embodiment, for better illustration of this embodiment, the text display component is taken as a TextView control as an example, and in other alternative embodiments, the text display component may also be other components, which is not limited in this application.
In the prior art, when the electronic device needs to display text, a TextView control installed in the electronic device is called to realize the display function of the text. The textView control determines the window size required for displaying the whole text according to the default text layout of the system and the text layout preset by a developer or a user, and generates a display window according to the window size so as to display all the texts to be displayed in the display window. However, for text with a large number of characters, when the display window is generated by using the TextView control, the required window size is large, which may cause the display window to obscure other display contents on the display interface, and the display effect is not good.
In the embodiment, in order to improve the display effect of the text display component including the TextView control, the display switching operation triggered by the user to the first text display window displayed on the display interface is received; and according to the display position of the first text display window on the display interface, extending the first text display window along a preset direction corresponding to the display position so as to form and display a second text display window on the display interface. The first display window is used for displaying a text to be displayed with a preset line number according to a preset display layout; and the second text display window is used for displaying all the texts to be displayed.
Specifically, when the electronic device needs to display a text, a TextView control installed in the electronic device is called, and the TextView control can generate a first text display window. Optionally, before the TextView control is to be called, the TextView control may receive a display layout configuration of a developer or a user for the first display window, so that the first window displays a preset number of lines of text to be displayed according to the display layout configuration; the display layout configuration comprises the number of displayable text lines, the distance between the text and the upper and lower reference lines of the display window, the text font and the text character size, and the like. It should be noted that the upper reference line refers to a boundary line of an upper edge of the window of the display window; the upper reference line refers to a boundary line of a lower edge of the window of the display window.
Subsequently, the text display component can receive a display switching operation triggered by a user on a first text display window displayed on the display interface. The display switching operation may be performed in various manners based on the type of the electronic device on which the text display component is based, for example, when the electronic device includes a touch display screen, the display switching operation may specifically be a point touch operation, a sliding operation, a pressing operation, and the like of a user on a position on the touch display screen where the first text display window is displayed; when the electronic device includes a common display screen, the display switching operation may specifically be a single-click operation, a double-click operation, a combined click operation, and the like performed by a user on a position on the common display screen where the first text display window is displayed through the input device; it is to be understood that the present application is not limited to a specific form of the display switching operation.
And then, extending the first text display window along a preset direction corresponding to the display position according to the display position of the first text display window on the display interface by using a text display component TextView control so as to form and display a second text display window on the display interface, wherein the second text display window is used for displaying all texts to be displayed. Specifically, the TextView control may adjust a function to determine a display position of the first text display window on the display interface, for example, when the first text display window is located at an upper portion of the display interface, it may extend to a lower portion of the display interface to display more text, i.e., to obtain a second text display window; when the first text display window is positioned at the lower part of the display interface, the first text display window can extend towards the upper part of the display interface to display more texts, namely, a second text display window is obtained; of course, in other alternative embodiments, when the first text display window is located in the middle of the display interface, it may extend both towards the upper and lower portions of the display interface to display more text, i.e. to obtain the second text display window. In the present embodiment, specific ranges of the upper portion, the middle portion, and the lower portion of the display interface are not limited.
In addition, when the TextView control is called to switch from the first text display window to the second text display window, dynamic change can be adopted, namely, a dynamic display function such as an analyzer is called to complete the dynamic change effect. Of course, optionally, in the change process, the first text display window extends along a preset direction corresponding to the display position according to a preset extension speed, and the second text display window is formed and displayed on the display interface, where the extension speed may be preset by a developer, and this is not limited in this application.
In the text display method provided by the first embodiment of the present invention, a display switching operation triggered by a user on a first text display window displayed on a display interface is received; the first display window is used for displaying a text to be displayed with a preset line number according to a preset display layout; according to the display position of the first text display window on the display interface, the first text display window is extended along the preset direction corresponding to the display position, so that a second text display window is formed and displayed on the display interface, wherein the second text display window is used for displaying all texts to be displayed, and therefore the intelligent display method is provided, the display flexibility is improved, and particularly good display effect and user experience are provided for the display of large text information.
On the basis of the first embodiment, in order to further explain the text display method provided by the present invention, fig. 2 is a schematic flow chart of a text display method provided by a second embodiment of the present invention. As shown in fig. 2, the text display method includes:
step 201, receiving a display switching operation triggered by a user to a first text display window displayed on a display interface; the first display window is used for displaying the text to be displayed with the preset line number according to the preset display layout.
Step 202, judging whether the first text display window displays all texts to be displayed;
if yes, go to step 203; if not, go to step 204.
Step 203, keeping displaying the first text display window on the display interface;
step 204, according to the display position of the first text display window on the display interface, extending the first text display window along a preset direction corresponding to the display position to form and display a second text display window on the display interface, wherein the second text display window is used for displaying all texts to be displayed.
It should be noted that the main execution body of the text display method provided in the second embodiment of the present invention is a text display component, where the text display component may be a plug-in or a control installed on an electronic device, and the electronic device may be an electronic product installed with each operating system. The electronic product can be a mobile terminal, a tablet computer, a portable intelligent device and the like. The display interface refers to an operation interface, an operation state or an operation interface of the electronic device, which is displayed to a user by a display unit of the electronic device, and the display unit refers to a display screen, a display and a display area on the electronic device. In addition, the program loaded in the text display component can be written by C/C + +, Java, Shell or Python.
Similar to the example, in the present embodiment, for better illustrating the present embodiment, the text display component is taken as a TextView control as an example, in other alternative embodiments, the text display component may also be other components, and the application does not limit this. In order to improve the display effect of a text display component comprising a TextView control, receiving display switching operation triggered by a user on a first text display window displayed on a display interface; and according to the display position of the first text display window on the display interface, extending the first text display window along a preset direction corresponding to the display position so as to form and display a second text display window on the display interface. The first display window is used for displaying a text to be displayed with a preset line number according to a preset display layout; and the second text display window is used for displaying all the texts to be displayed.
Specifically, when the electronic device needs to display a text, a TextView control installed in the electronic device is called, and the TextView control can generate a first text display window.
Optionally, before the TextView control is to be called, the TextView control may receive a display layout configuration of a developer or a user for the first display window, so that the first window displays a preset number of lines of text to be displayed according to the display layout configuration; the display layout configuration comprises the number of displayable text lines, the distance between the text and the upper and lower reference lines of the display window, the text font and the text character size, and the like. It should be noted that the upper reference line refers to a boundary line of an upper edge of the window of the display window; the upper reference line refers to a boundary line of a lower edge of the window of the display window. Further, in the display layout configuration of the first display window, the setting of the extending direction thereof may be further included, and in the present embodiment, it may be set to a vertical direction, that is, a direction perpendicular to the direction in which characters in the text are arranged.
In addition, it should be noted that, after the TextView control can receive the display layout configuration of the first display window by the developer or the user, the requestLayout function can be used to notify and trigger onMesure to re-range and draw the first display window. Of course, other functions may also be called in the process, which is not limited in this application.
Subsequently, the text display component can receive a display switching operation triggered by a user on a first text display window displayed on the display interface. The display switching operation may be performed in various manners based on the type of the electronic device on which the text display component is based, for example, when the electronic device includes a touch display screen, the display switching operation may specifically be a point touch operation, a sliding operation, a pressing operation, and the like of a user on a position on the touch display screen where the first text display window is displayed; when the electronic device includes a common display screen, the display switching operation may specifically be a single-click operation, a double-click operation, a combined click operation, and the like performed by a user on a position on the common display screen where the first text display window is displayed through the input device; it is to be understood that the present application is not limited to a specific form of the display switching operation.
Different from the first embodiment, in the second embodiment, after receiving a display switching operation triggered by a user on a first text display window displayed on a display interface, a text display component determines whether the first text display window displays all texts to be displayed; if so, keeping displaying the first text display window on the display interface; and if not, executing a step of extending the first text display window along a preset direction corresponding to the display position according to the display position of the first text display window on the display interface so as to form and display a second text display window on the display interface.
In the step of determining whether the first text display window displays all texts to be displayed, an existing function, such as textview.
And then, extending the first text display window along a preset direction corresponding to the display position according to the display position of the first text display window on the display interface by using a text display component TextView control so as to form and display a second text display window on the display interface, wherein the second text display window is used for displaying all texts to be displayed.
Specifically, unlike the first embodiment, the TextView control may adjust a function to determine the display position of the first text display window on the display interface:
fig. 3 is a schematic diagram of a display window transformation according to a second embodiment of the present invention; fig. 4 is a schematic diagram of another display window transformation according to the second embodiment of the present invention.
As shown in fig. 3, when the display position is located in the upper preset region of the display interface, the first text display window 31 is expanded toward the lower portion of the display interface in the vertical direction to form and display a second text display window 32 on the display interface, the position of the upper reference line 33 of the second text display window being the same as the position of the upper reference line 33 of the first text display window 41; as shown in fig. 4, when the display position is located within the lower preset region of the display interface, the first text display window 41 is expanded toward the upper portion of the display interface in the vertical direction to form and display a second text display window 42 on the display interface, and the position of the lower reference line 43 of the second text display window 42 is the same as the position of the lower reference line 43 of the first text display window 41.
Meanwhile, in this embodiment, the process of extending the first text display window along a preset direction corresponding to the display position to form and display a second text display window on the display interface may specifically include:
determining the maximum rendering height of the text to be displayed; the rendering maximum height is generally related to the following parameters: the position of the upper reference line, the distance between the top of the text and the upper reference line, and the distance between the bottom of the text and the lower reference line. Determining the window height of a second text display window according to the maximum rendering height, the distance between the preset text to be displayed and the upper reference line and the distance between the text to be displayed and the lower reference line; determining an extension distance according to the preset window height of the first window and the preset window height of the second text display window; and extending the first text display window along a preset direction corresponding to the display position by the extending distance so as to form and display a second text display window on the display interface.
In addition, when the TextView control is called to switch from the first text display window to the second text display window, dynamic change can be adopted, namely, a dynamic display function such as an analyzer is called to complete the dynamic change effect. Of course, optionally, in the change process, the first text display window extends along a preset direction corresponding to the display position according to a preset extension speed, and the second text display window is formed and displayed on the display interface, where the extension speed may be preset by a developer, and this is not limited in this application.
The second embodiment of the invention provides a text display method, and on the basis of the first embodiment, whether all texts to be displayed are displayed in the first text display window is judged, so that the display effect of the text display method is further improved, and the user experience is improved.
Fig. 5 is a schematic structural diagram of a text display assembly according to a third embodiment of the present invention, and as shown in fig. 5, the text display assembly includes:
the display switching device comprises a triggering unit 10, a display unit and a display unit, wherein the triggering unit is used for receiving display switching operation triggered by a user on a first text display window displayed on a display interface; the first display window is used for displaying a text to be displayed with a preset line number according to a preset display layout;
the display unit 20 is configured to extend the first text display window along a preset direction corresponding to the display position according to the display position of the first text display window on the display interface, so as to form and display a second text display window on the display interface, where the second text display window is used to display all texts to be displayed.
In one optional implementation, the text display assembly further comprises: a judgment unit;
the judging unit is used for judging whether the first text display window displays all texts to be displayed or not after the triggering unit 10 receives a display switching operation triggered by a user on the first text display window displayed on a display interface; if yes, the display unit 20 keeps displaying the first text display window on the display interface; if not, the display unit 20 executes a step of extending the first text display window along a preset direction corresponding to the display position according to the display position of the first text display window on the display interface, so as to form and display a second text display window on the display interface.
In an optional implementation manner, the display unit 20 is specifically configured to:
when the display position is located in an upper preset area of the display interface, the first text display window is expanded towards the lower part of the display interface along the vertical direction so as to form and display a second text display window on the display interface, and the position of an upper reference line of the second text display window is the same as that of the upper reference line of the first text display window.
In an optional implementation manner, the display unit 20 is specifically configured to:
when the display position is located in a lower preset area of the display interface, the first text display window is expanded towards the upper part of the display interface along the vertical direction so as to form and display a second text display window on the display interface, and the position of a lower reference line of the second text display window is the same as that of the lower reference line of the first text display window.
In an optional implementation manner, the display unit 20 is specifically configured to:
determining the maximum rendering height of the text to be displayed;
determining the window height of a second text display window according to the maximum rendering height, the distance between the preset text to be displayed and the upper reference line and the distance between the text to be displayed and the lower reference line;
determining an extension distance according to the preset window height of the first window and the preset window height of the second text display window;
and extending the first text display window along a preset direction corresponding to the display position by the extending distance so as to form and display a second text display window on the display interface.
In an alternative embodiment, the display unit 20 is further configured to:
and extending the first text display window along a preset direction corresponding to the display position according to a preset extending speed, and forming and displaying a second text display window on the display interface.
In an optional implementation manner, the triggering unit 10 is further configured to receive a display layout configuration of a first display window before receiving a display switching operation triggered by a user on the first text display window displayed on the display interface, so that the display unit 20 displays a preset number of lines of text to be displayed in the first display window according to the display layout configuration; wherein the display layout configuration includes a realistic number of lines of text.
The text display component provided by the third embodiment of the invention receives the display switching operation triggered by the user to the first text display window displayed on the display interface; the first display window is used for displaying a text to be displayed with a preset line number according to a preset display layout; according to the display position of the first text display window on the display interface, the first text display window is extended along the preset direction corresponding to the display position, so that a second text display window is formed and displayed on the display interface, wherein the second text display window is used for displaying all texts to be displayed, and therefore the intelligent display method is provided, the display flexibility is improved, and particularly good display effect and user experience are provided for the display of large text information.
Fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. As shown in fig. 6, the electronic apparatus includes: a display unit 53, a memory 51, a processor 52 and a computer program stored on the memory 51 and executable on the processor 52, the processor 52 executing the method of any of the above embodiments when executing the computer program, the display unit 53 being configured to provide a display interface.
The invention also provides a readable storage medium comprising a program which, when run on an electronic device, causes the electronic device to perform the method of any of the embodiments described above.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (16)

1. A text display method, comprising:
receiving display switching operation triggered by a user on a first text display window displayed on a display interface; the first display window is used for displaying a text to be displayed with a preset line number according to a preset display layout;
according to the display position of the first text display window on a display interface, extending the first text display window along a preset direction corresponding to the display position so as to form and display a second text display window on the display interface, wherein the second text display window is used for displaying all texts to be displayed.
2. The text display method according to claim 1, wherein after receiving a user-triggered display switching operation on the first text display window displayed on the display interface, the method further comprises:
judging whether the first text display window displays all texts to be displayed or not;
if so, keeping displaying the first text display window on the display interface;
and if not, executing a step of extending the first text display window along a preset direction corresponding to the display position according to the display position of the first text display window on the display interface so as to form and display a second text display window on the display interface.
3. The text display method according to claim 1, wherein the extending the first text display window along a preset direction corresponding to the display position according to the display position of the first text display window on the display interface to form and display a second text display window on the display interface comprises:
when the display position is located in an upper preset area of the display interface, the first text display window is expanded towards the lower part of the display interface along the vertical direction so as to form and display a second text display window on the display interface, and the position of an upper reference line of the second text display window is the same as that of the upper reference line of the first text display window.
4. The text display method according to claim 1, wherein the extending the first text display window along a preset direction corresponding to the display position according to the display position of the first text display window on the display interface to form and display a second text display window on the display interface comprises:
when the display position is located in a lower preset area of the display interface, the first text display window is expanded towards the upper part of the display interface along the vertical direction so as to form and display a second text display window on the display interface, and the position of a lower reference line of the second text display window is the same as that of the lower reference line of the first text display window.
5. The text display method according to any one of claims 1 to 4, wherein the extending the first text display window in a preset direction corresponding to the display position to form and display a second text display window on the display interface comprises:
determining the maximum rendering height of the text to be displayed;
determining the window height of a second text display window according to the maximum rendering height, the distance between the preset text to be displayed and the upper reference line and the distance between the text to be displayed and the lower reference line;
determining an extension distance according to the preset window height of the first window and the preset window height of the second text display window;
and extending the first text display window along a preset direction corresponding to the display position by the extending distance so as to form and display a second text display window on the display interface.
6. The text display method according to any one of claims 1 to 4, further comprising:
and the first text display window extends along a preset direction corresponding to the display position according to a preset extension speed, and a second text display window is formed and displayed on the display interface.
7. The text display method according to any one of claims 1 to 4, wherein before receiving a user-triggered display switching operation on the first text display window displayed on the display interface, the method further comprises:
receiving display layout configuration of a first display window, so that the first window can display a text to be displayed with a preset line number according to the display layout configuration; wherein the display layout configuration includes a number of displayable lines of text.
8. A text display assembly, comprising:
the triggering unit is used for receiving display switching operation triggered by a user on a first text display window displayed on a display interface; the first display window is used for displaying a text to be displayed with a preset line number according to a preset display layout;
the display unit is used for extending the first text display window along a preset direction corresponding to the display position according to the display position of the first text display window on the display interface so as to form and display a second text display window on the display interface, wherein the second text display window is used for displaying all texts to be displayed.
9. The text display assembly of claim 8, further comprising: a judgment unit;
the judging unit is used for judging whether the first text display window displays all texts to be displayed or not after the triggering unit receives display switching operation triggered by a user on the first text display window displayed on a display interface; if so, the display unit keeps displaying the first text display window on the display interface; if not, the display unit executes a step of extending the first text display window along a preset direction corresponding to the display position according to the display position of the first text display window on the display interface so as to form and display a second text display window on the display interface.
10. The text display assembly of claim 8, wherein the display unit is specifically configured to:
when the display position is located in an upper preset area of the display interface, the first text display window is expanded towards the lower part of the display interface along the vertical direction so as to form and display a second text display window on the display interface, and the position of an upper reference line of the second text display window is the same as that of the upper reference line of the first text display window.
11. The text display assembly of claim 8, wherein the display unit is specifically configured to:
when the display position is located in a lower preset area of the display interface, the first text display window is expanded towards the upper part of the display interface along the vertical direction so as to form and display a second text display window on the display interface, and the position of a lower reference line of the second text display window is the same as that of the lower reference line of the first text display window.
12. The text display assembly according to any one of claims 8-11, wherein the display unit is specifically configured to:
determining the maximum rendering height of the text to be displayed;
determining the window height of a second text display window according to the maximum rendering height, the distance between the preset text to be displayed and the upper reference line and the distance between the text to be displayed and the lower reference line;
determining an extension distance according to the preset window height of the first window and the preset window height of the second text display window;
and extending the first text display window along a preset direction corresponding to the display position by the extending distance so as to form and display a second text display window on the display interface.
13. The text display assembly of any one of claims 8-11, wherein the display unit is further configured to:
and extending the first text display window along a preset direction corresponding to the display position according to a preset extending speed, and forming and displaying a second text display window on the display interface.
14. The text display assembly according to any one of claims 8 to 11, wherein the triggering unit is further configured to receive a display layout configuration of a first display window before receiving a display switching operation triggered by a user on the first text display window displayed on the display interface, so that the display unit displays a preset number of lines of text to be displayed in the first display window according to the display layout configuration; wherein the display layout configuration includes a realistic number of lines of text.
15. An electronic device, comprising: a display unit, a memory, a processor connected to the memory, and a computer program stored on the memory and executable on the processor,
the display unit is used for providing a display interface;
the processor, when executing the computer program, performs the method of any of claims 1-7.
16. A readable storage medium, characterized by comprising a program which, when run on an electronic device, causes the electronic device to perform the method of any one of claims 1-7.
CN201810887007.8A 2018-08-06 2018-08-06 Text display method, component, electronic device and readable storage medium Pending CN110806824A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810887007.8A CN110806824A (en) 2018-08-06 2018-08-06 Text display method, component, electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810887007.8A CN110806824A (en) 2018-08-06 2018-08-06 Text display method, component, electronic device and readable storage medium

Publications (1)

Publication Number Publication Date
CN110806824A true CN110806824A (en) 2020-02-18

Family

ID=69487316

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810887007.8A Pending CN110806824A (en) 2018-08-06 2018-08-06 Text display method, component, electronic device and readable storage medium

Country Status (1)

Country Link
CN (1) CN110806824A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111638839A (en) * 2020-05-20 2020-09-08 维沃移动通信有限公司 Screen capturing method and device and electronic equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0816517A (en) * 1994-06-30 1996-01-19 Sharp Corp Method and device for window control
JP2000194464A (en) * 1998-12-25 2000-07-14 Ntt Data Corp Form image display system and recording medium
US20080244422A1 (en) * 2007-03-28 2008-10-02 Sap Ag Column layout
CN102118509A (en) * 2011-03-15 2011-07-06 宇龙计算机通信科技(深圳)有限公司 Method for displaying short message in mobile terminal and mobile terminal
CN103729185A (en) * 2013-12-30 2014-04-16 广州金山网络科技有限公司 Display method and system for folding window
CN105677834A (en) * 2016-01-06 2016-06-15 北京京东尚科信息技术有限公司 Information showing method and device
CN106648639A (en) * 2016-12-09 2017-05-10 武汉斗鱼网络科技有限公司 Android system-based text gradient method and system
CN108055191A (en) * 2017-11-17 2018-05-18 深圳市金立通信设备有限公司 Information processing method, terminal and computer readable storage medium
CN108052369A (en) * 2017-12-29 2018-05-18 北京酷我科技有限公司 A kind of text control in android system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0816517A (en) * 1994-06-30 1996-01-19 Sharp Corp Method and device for window control
JP2000194464A (en) * 1998-12-25 2000-07-14 Ntt Data Corp Form image display system and recording medium
US20080244422A1 (en) * 2007-03-28 2008-10-02 Sap Ag Column layout
CN102118509A (en) * 2011-03-15 2011-07-06 宇龙计算机通信科技(深圳)有限公司 Method for displaying short message in mobile terminal and mobile terminal
CN103729185A (en) * 2013-12-30 2014-04-16 广州金山网络科技有限公司 Display method and system for folding window
CN105677834A (en) * 2016-01-06 2016-06-15 北京京东尚科信息技术有限公司 Information showing method and device
CN106648639A (en) * 2016-12-09 2017-05-10 武汉斗鱼网络科技有限公司 Android system-based text gradient method and system
CN108055191A (en) * 2017-11-17 2018-05-18 深圳市金立通信设备有限公司 Information processing method, terminal and computer readable storage medium
CN108052369A (en) * 2017-12-29 2018-05-18 北京酷我科技有限公司 A kind of text control in android system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111638839A (en) * 2020-05-20 2020-09-08 维沃移动通信有限公司 Screen capturing method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN109164964B (en) Content sharing method and device, terminal and storage medium
CN109062479B (en) Split screen application switching method and device, storage medium and electronic equipment
US10237622B2 (en) Page turning method, page turning apparatus and terminal as well as computer readable medium
US20090002324A1 (en) Method, Apparatus and Computer Program Product for Providing a Scrolling Mechanism for Touch Screen Devices
US8832591B2 (en) Grid display device and grid display method in mobile terminal
US20140304625A1 (en) Page returning
WO2014134939A1 (en) Method, apparatus and computer readable storage medium for displaying sidebar information
WO2015043442A1 (en) Method, device and mobile terminal for text-to-speech processing
US20160004420A1 (en) Electronic device and computer program product
US20230117213A1 (en) Page display method and electronic device
US20170161098A1 (en) Method, device, and terminal for switching operating systems
CN108984089B (en) Touch operation method and device, storage medium and electronic equipment
US20170090725A1 (en) Selecting at least one graphical user interface item
US20150234576A1 (en) Method and apparatus for displaying information and electronic device adapted to the method
US20170139584A1 (en) User account switching interface
CN105808514A (en) Information processing method and electronic device
CN107562324B (en) Data display control method and terminal
EP3043251A1 (en) Method of displaying content and electronic device implementing same
CN110806824A (en) Text display method, component, electronic device and readable storage medium
US20170168694A1 (en) Method and electronic device for adjusting sequence of shortcut switches in control center
CN109683755B (en) User interface display method and device, electronic equipment and storage medium
CN109117072B (en) Writing area control method and system, writing method and system and interactive intelligent tablet
CN112840305A (en) Font switching method and related product
US20140250407A1 (en) Method, apparatus and computer readable storage medium for displaying sidebar information
CN112948730A (en) Webpage data display method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200423

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

Address before: 510627 Guangdong city of Guangzhou province Whampoa Tianhe District Road No. 163 Xiping Yun Lu Yun Ping square B radio tower 15 layer self unit 02

Applicant before: GUANGZHOU UC NETWORK TECHNOLOGY Co.,Ltd.