CN112612450A - Method, device, terminal and storage medium for implementing text input box - Google Patents

Method, device, terminal and storage medium for implementing text input box Download PDF

Info

Publication number
CN112612450A
CN112612450A CN202011502725.2A CN202011502725A CN112612450A CN 112612450 A CN112612450 A CN 112612450A CN 202011502725 A CN202011502725 A CN 202011502725A CN 112612450 A CN112612450 A CN 112612450A
Authority
CN
China
Prior art keywords
character
text
information
cursor
input box
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
CN202011502725.2A
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011502725.2A priority Critical patent/CN112612450A/en
Publication of CN112612450A publication Critical patent/CN112612450A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Abstract

The invention discloses a method, a device, a terminal and a storage medium for realizing a text input box, wherein the method for realizing the text input box comprises the following steps: acquiring text information which is input in a text input box by a user and comprises at least one character based on a text input control existing in the current development environment; determining character style information of each character in the text information, wherein the character style information is used for recording the display style of the character; and displaying the character in the display mode recorded by the character mode information of each character in the text input box so as to display the text information in the text input box. Therefore, the method and the device can set the corresponding style for each input character and display the character according to the style corresponding to each character when the text input box is realized, thereby better meeting the diversified character style requirements when the text input box is realized and reducing the development difficulty of the text input box. The invention also relates to the technical field of block chains.

Description

Method, device, terminal and storage medium for implementing text input box
Technical Field
The invention relates to the technical field of computer interface design, in particular to a method, a device, a terminal and a storage medium for realizing a text input box.
Background
In the development process of a computer interface, the implementation of a text input box is a common functional implementation. In order to simplify the development process, there are usually preset controls in the development environment for implementing the text input box, for example, the UITextField control in the IOS environment. Controls for implementing text entry boxes typically include at least two part functionality: (1) monitoring a text input by a user in a text input box, (2) displaying the monitored text on an interface, and realizing the function of inputting the text into the text input box in the interface by combining the functions of the two parts.
However, due to the limitation of the rules of the control carried by the development environment, the simple use of the control to implement the text input box cannot well meet the development requirements of diversified text input boxes, and may also increase the difficulty of development. For example, when the control carried by the development environment displays the input text, the style of the displayed text is generally uniformly set, and if some personalized text styles are to be implemented, more complex development logic is generally required to be set for implementation, which greatly increases the difficulty of development. (e.g., the spacing between characters of the text in the control is generally uniform, and if different input characters are to be implemented, the spacing is generally implemented by inserting a space, and the implementation logic of this implementation is generally complex, for example, to implement a text input box in a spacing format such as "12345", in which the spacing between the numbers 1, 2, 3, 4, and 5 is uniform, but the spacing between the number 3 and the number 4 is not the same as the spacing between other numbers, so that the development generally needs to implement the space by inserting a space character, and after the input of the numbers 1, 2, and 3 is obtained, a space character is automatically inserted, so that when the input of the number 4 is obtained, the spacing between the number 4 and the number 3 is increased, and when the number 4 needs to be deleted, a space character also needs to be automatically deleted, the cursor can be brought back to the number 3, which makes it possible to make the spacing between the number 3 and the number 4 different from the spacing between the other numbers. Such a logic is complex, and the adjustment of the space can only be performed by taking the space of the space characters as a unit, and cannot meet the personalized requirement of further refinement). Therefore, the method for realizing the flexible text input box is provided, the development requirements of diversified text input boxes are met, and the reduction of the development difficulty of the text input box is particularly important.
Disclosure of Invention
The technical problem to be solved by the invention is that the control for realizing the text input box in the existing development environment cannot well meet the development requirement of diversified text input boxes, and the development difficulty can be increased.
In order to solve the technical problem, a first aspect of the present invention discloses a method for implementing a text input box, where the method includes:
acquiring text information which is input in the text input box by a user and comprises at least one character based on a text input control existing in the current development environment;
determining character style information of each character in the text information, wherein the character style information is used for recording the display style of the character;
and displaying each character in the text input box in the display mode recorded by the character mode information of the character so as to display the text information in the text input box.
The second aspect of the present invention discloses an implementation apparatus for a text input box, the apparatus comprising:
the acquisition module is used for acquiring text information which is input in the text input box by a user and comprises at least one character based on the existing text input control in the current development environment;
the determining module is used for determining character style information of each character in the text information, and the character style information is used for recording the display style of the character;
and the display module is used for displaying the character in the display style recorded by the character style information of each character in the text input box so as to display the text information in the text input box.
The third aspect of the present invention discloses a terminal for implementing a text input box, wherein the terminal comprises:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute part or all of the steps in the implementation method of the text input box disclosed by the first aspect of the invention.
In a fourth aspect of the present invention, a computer storage medium is disclosed, which stores computer instructions for performing some or all of the steps of the method for implementing a text input box disclosed in the first aspect of the present invention when the computer instructions are called.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, the text information input by a user is obtained through the existing text input control in the development environment, then the character style information of each character in the text information is determined, and finally the character is displayed in the text input box in the display style recorded by the character style information of each character, thereby completing the realization of the text input box. Therefore, when the method and the device are implemented, the corresponding style can be set for each input character when the text input box is realized, and the character is displayed according to the style corresponding to each character, so that the requirements of diversified character styles when the text input box is realized can be well met, and the development difficulty of the text input box is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart illustrating a method for implementing a text entry box according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of an apparatus for implementing a text entry box according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a terminal for implementing a text entry box according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer storage medium according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," and the like in the description and claims of the present invention and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, article, or article that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or article.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The invention discloses a method, a device, a terminal and a storage medium for realizing a text input box, which can set a corresponding style for each input character and display the character according to the style corresponding to each character when realizing the text input box, thereby better meeting the diversified character style requirements when realizing the text input box and reducing the development difficulty of the text input box. The following are detailed below.
Example one
Referring to fig. 1, fig. 1 is a schematic flow chart of a method for implementing a text entry box according to an embodiment of the present invention. As shown in fig. 1, the implementation method of the text input box may include the following operations:
101. and acquiring text information which is input in a text input box by a user and comprises at least one character based on the existing text input control in the current development environment.
In the step 101, the text input control is designed in advance in a development environment, and can be directly called by a developer during development, and the text input by the user can be monitored by calling the control. For example, when the development environment is an IOS environment, the text input control can be a UITextField control in the IOS environment.
102. Character style information of each character in the text information is determined, and the character style information is used for recording the display style of the character.
In the step 102, character style information (described later) of each character may be predetermined or may be automatically generated after listening to the input character. The determination process of the character style information on each character can be referred to the following description. In an actual development process, a container inputCodeView may be provided, and then an iitemView is added to the container inputCodeView, where one iitemView corresponds to one input character, and character style information corresponding to the character is stored in the iitemView corresponding to the character. For example, if the text information input by the user includes 3 characters, 3 iitemviews are added to the container inputCodeView, and the character style information corresponding to each of the 3 characters is stored in the 3 iitemviews. Specifically, a for loop may be created to add the number of iitemView according to the number of characters in the acquired text information. In each iitemView, a custom label can be used for storing corresponding character style information. Optionally, an array may be provided in the container inputCodeView to store all the iitemViews added.
103. And displaying the character in the display mode recorded by the character mode information of each character in the text input box so as to display the text information in the text input box.
In the above step 103, the character style information is used to record the display style of the character, that is, the character style information determines the style such as font size, font color, font interval, etc. when the character is displayed in the text input box. Because each character in the text information is provided with the character style information which corresponds to the character independently, different styles can be set for each character when the text information is displayed, and therefore the diversified requirements on the styles of the characters in the text input box in the development process can be met.
Therefore, when the implementation method of the text input box described in fig. 1 is implemented, a corresponding style can be set for each input character when the text input box is implemented, and the character is displayed according to the style corresponding to each character, so that the diversified character style requirements when the text input box is implemented can be well met, and the development difficulty of the text input box is reduced.
In an alternative embodiment, there is a corresponding cursor display tag for each character, and the cursor display tag is used to indicate that the cursor corresponding to the character is displayed or not displayed;
and after acquiring text information which is input by a user in the text input box and comprises at least one character based on the existing text input control in the current development environment, the implementation method of the text input box further comprises the following steps:
setting each cursor display label according to the number of characters included in the text information;
judging whether the cursor display label corresponding to each character is used for indicating cursor display corresponding to the character;
when the cursor display label corresponding to the character is judged to be used for indicating cursor display corresponding to the character, displaying a cursor corresponding to the character in the text input box;
and when the cursor display label corresponding to the character is judged to be used for indicating that the cursor corresponding to the character is not displayed, not displaying the cursor corresponding to the character in the text input box.
It is also an important part to set the display of a cursor in a text entry box according to the text entered by the user during the implementation in the text entry box. In this alternative embodiment, the cursor display in the text input box is realized by presetting a cursor for each character input and then by controlling the display state (display or non-display) of the cursor for each character in the text input box. Specifically, the number of characters included in the text information may be obtained first, and after the number of characters is obtained, which character is the last character in the text information may be determined, then a cursor corresponding to the last character is set to be in a display state, and cursors corresponding to other characters are set to be in a non-display state, so that the displayed cursor may change along with the change of the character length of the text information input by the user, and the cursor is always displayed behind the last character in the text information input by the user, thereby realizing cursor display in the text input box. For example, if the text information input by the user is "1, 2, 3", the corresponding cursor exists for each of the characters 1, 2, 3, but since the character 3 is the last character, only the cursor corresponding to the character 3 is displayed, and the cursors for the characters 1, 2 are not displayed, so that the cursor is displayed in the text input box.
Therefore, by implementing the optional embodiment, the cursor is preset for each character in the input text information, and then the display state of each cursor is set according to the number of the characters included in the text information, so that the cursor display in the text input box is realized, and the requirement for realizing the cursor when the text input box is realized is met.
In this optional embodiment, further optionally, each character further has corresponding cursor style information, and the cursor style information is used to record a display style of a cursor corresponding to the character;
and after acquiring text information which is input by a user in the text input box and comprises at least one character based on the existing text input control in the current development environment, the implementation method of the text input box further comprises the following steps:
determining cursor style information of each character in the text information;
and when the cursor display label corresponding to the character is judged to be used for indicating the cursor display corresponding to the character, displaying the cursor corresponding to the character in the text input box, wherein the method comprises the following steps:
and when the cursor display label corresponding to the character is judged to be used for indicating the cursor display corresponding to the character, displaying the cursor corresponding to the character in the display mode recorded by the cursor mode information corresponding to the character in the text input box.
In this further alternative embodiment, during the implementation of the cursor in the text input box, corresponding cursor style information (described later) also exists for each character for recording the display style of the cursor corresponding to the character. When the cursor is displayed, the cursor is displayed according to the display style recorded by the cursor style information, so that the cursor corresponding to different characters can be displayed in different display styles.
Therefore, by implementing the further optional embodiment, the cursor style information corresponding to each cursor is set, and then the cursor is displayed according to the display style recorded by the cursor style information when the cursor is displayed, so that the cursors corresponding to different characters can be displayed in different display styles, the requirement of diversified cursor styles during the implementation of the text input box can be met, and the development difficulty of the text input box is reduced.
In another alternative embodiment, determining character style information for each character in the text message comprises:
according to each character in the text information, screening target first character style information from a predetermined first character style information set to serve as the character style information of the character, wherein the first character style information set comprises a plurality of first character style information, and each first character style information has a corresponding character; alternatively, the first and second electrodes may be,
determining first text position information corresponding to each character according to the position of each character in the text information;
and according to the first text position information of each character, screening target second character style information from a predetermined second character style information set to serve as the character style information of the character, wherein the second character style information set comprises a plurality of second character style information, and each second character style information has corresponding first text position information.
In this alternative embodiment, the determination of the character style information for each character may be performed in two ways:
(a) the method includes the steps of firstly presetting a first character style information set, enabling different characters to correspond to different first character style information in the preset first character style information set, then, after the input text information is obtained, setting the character style information of the characters in the input text information as the corresponding first character style information of the characters in the first character style information set, and finally, displaying the characters through the corresponding first character style information of the characters when the characters are displayed. For example, if the display style recorded in the first character style information corresponding to the character 1 is "regular script, four-point font, red font", and the display style recorded in the first character style information corresponding to the character 2 is "song style, five-point font, black font", when the characters in the input text information are displayed, all the characters 1 in the input text information are displayed as the four-point red regular script, and all the characters 2 in the input text information are displayed as the five-point black song style. In this way, different characters in the input text information can be displayed in different display styles in the text input box.
(b) The method includes the steps of firstly presetting a second character style information set, corresponding different second character style information to different positions in text information in the preset second character style information set, then, after the input text information is obtained, setting the character style information of characters at different positions in the text information as the corresponding second character style information of the positions in the second character style information set, and finally, displaying the characters through the corresponding second character style information of the positions of the characters when the characters are displayed. For example, the display style recorded by the second character style information corresponding to the position No. 1 is "a regular body, a four-point font, and a red font", the display style recorded by the second character style information corresponding to the position No. 2 is "a song body, a five-point font, and a black font", if the input text information is "12", the character 1 is at the position No. 1 of the text information, and the character 2 is at the position No. 2 of the text information, and when the characters in the text information are displayed, the character 1 is displayed as the four-point red regular body, and the character 2 is displayed as the five-point black body. In this way, characters at different positions in the input text information can be displayed in different display styles in the text input box.
Therefore, by implementing the alternative embodiment, the characters can be displayed in different display styles according to different characters or different positions of the characters in the text information, and personalized display can be realized for each character in the text input box.
In yet another alternative embodiment, determining cursor style information for each character in the text message comprises:
according to each character in the text information, screening target first cursor style information from a predetermined first cursor style information set to serve as cursor style information of the character, wherein the first cursor style information set comprises a plurality of first cursor style information, and each first cursor style information has a corresponding character; alternatively, the first and second electrodes may be,
determining second text position information corresponding to each character according to the position of each character in the text information;
and according to the second text position information of each character, screening target second cursor style information from a predetermined second cursor style information set to serve as the cursor style information of the character, wherein the second cursor style information set comprises a plurality of pieces of second cursor style information, and each piece of second cursor style information has corresponding second text position information.
In this alternative embodiment, the cursor style information of the cursor corresponding to each character may be determined in the following two ways:
(a) the method includes the steps of firstly presetting a first cursor style information set, corresponding cursors corresponding to different characters to different first cursor style information in the preset first cursor style information set, then, after the input text information is obtained, setting the cursor style information corresponding to the characters in the input text information as the first cursor style information corresponding to the characters in the first cursor style information set, and finally, displaying the cursor corresponding to the characters by the first cursor style information corresponding to the characters when the cursor corresponding to the characters is displayed. For example, the display style recorded in the first cursor style information corresponding to the character 1 is "red cursor with a blinking interval of 1 s", the display style recorded in the first cursor style information corresponding to the character 2 is "black cursor with a blinking interval of 2 s", and when the cursor in the text input box is displayed, if the cursor corresponding to the character 1 needs to be displayed, the cursor corresponding to the character 1 is displayed as the red cursor with the blinking interval of 1s, and if the cursor corresponding to the character 2 needs to be displayed, the cursor corresponding to the character 2 is displayed as the black cursor with the blinking interval of 2 s. In this way, the cursors corresponding to different characters in the input text information can be displayed in different display styles in the text input box.
(b) The method includes the steps of firstly presetting a second cursor style information set, corresponding different second cursor style information to different positions in text information in the preset second cursor style information set, then, after the input text information is obtained, setting cursor style information of characters at different positions in the text information as second cursor style information corresponding to the positions in the second cursor style information set, and finally, displaying a cursor corresponding to the characters through the second cursor style information corresponding to the positions of the characters when a cursor corresponding to the characters is displayed. For example, the display style recorded by the second cursor style information corresponding to the position No. 1 is "red cursor with a blinking interval of 1 s", the display style recorded by the second cursor style information corresponding to the position No. 2 is "black cursor with a blinking interval of 2 s", if the input text information is "1", the cursor corresponding to the character 1 will be displayed, and since the character 1 is at the position No. 1 of the text information, the red cursor with a blinking interval of 1s is displayed behind the character 1. If the input text information is "12", the cursor corresponding to the character 2 will be displayed, and since the character 2 is at the position 2 of the text information, a black cursor with 2s flashing intervals is displayed behind the character 2. In this way, it is possible to display the cursors corresponding to the characters at different positions in the input text information in different display styles in the text input box.
Therefore, by implementing the further alternative embodiment, the cursor corresponding to the character can be displayed in different display styles according to the difference of the character or the difference of the position of the character in the text information, and the personalized display of the cursor corresponding to each character in the text input box can be realized.
In yet another optional embodiment, after acquiring text information including at least one character input by a user in a text input box based on existing text input controls in the current development environment, and before determining character style information of each character in the text information, the implementation method of the text input box further includes:
acquiring a character type corresponding to the text information;
judging whether a target character which does not belong to the character type exists in the text information or not;
and when the target character exists in the text information, deleting the target character from the text information, and triggering and executing the operation of determining the character style information of each character in the text information.
In this further alternative embodiment, the character type corresponding to the text information may be set according to an application scenario of the text input box, for example, if the text input box is used as an input box of a digital verification code, the character type corresponding to the text information may be set to be a numeric type, and if the text input box is used as an input box of chat content, the character type corresponding to the text information may be set to include a numeric type, a literal type, and an alphabetical type. Assuming that the text input box is used as an input box of the digital verification code, after the text information input by the user is acquired based on the text input control, characters which are not of the number type in the input text information are deleted from the text information, and then character style information of the characters in the text information is determined. For example, if the obtained text information input by the user is "12 me", the character "me" may be deleted, and a new text information "12" is obtained.
Therefore, by implementing the further alternative embodiment, filtering of the text information input by the text input box can be realized, so that the function of the text input box is increased, and the realized text input box is more intelligent.
In yet another optional embodiment, after acquiring the text information including at least one character input by the user in the text input box based on the existing text input control in the current development environment, the method for implementing the text input box further includes:
acquiring reference text information corresponding to the text information;
calculating an edit distance value between the text information and the reference text information based on a predetermined edit distance algorithm;
and setting the frame style and/or the background pattern of the text input box according to the editing distance value.
In this further alternative embodiment, the edit distance is the minimum number of edit operations between two strings required to transition one string to another. The larger the edit distance is, the smaller the similarity between the two character strings is represented. The reference text information corresponding to the text information may be set according to an application scenario of the text input box, for example, the text input box is used as an input box of the digital verification code, and if the correct digital verification code is "9527", the reference text information corresponding to the acquired text information is "9527", if the input text information is "9528", the calculated edit distance value may be 1, and if the input text information is "9538", the calculated edit distance value may be 2. Then, the border style and/or the background pattern of the text input box may be set differently according to the edit distance value. For example, when the edit distance value is 2, the border of the text input box is set to red, and when the edit distance value is 1, the border of the text input box is set to blue.
Therefore, by implementing the further optional embodiment, the edit distance value between the text information and the reference text information corresponding to the text information is calculated, and then the border style and/or the background pattern of the text input box are/is set according to the edit distance value, so that the similar situation of the text information input by the user and the reference text information can be prompted, the function of the text input box is increased, and the realized text input box is more intelligent.
Optionally, the character style information includes any one or more of character color information, character size information, character font information, character border color information, character border size information, character fillet information, and character pitch information.
Optionally, the cursor style information includes any one or more of cursor color information, cursor size information, cursor pattern information, cursor blinking interval information, cursor blinking animation information, cursor fillet information, and cursor spacing information.
Optionally, it is also possible: and uploading a display result obtained based on the implementation method of the text input box to a block chain.
Specifically, the display result obtained based on the implementation method of the text input box, specifically, the display result is obtained by running the implementation method of the text input box, and is used for indicating the text processing condition in the implementation process of the text input box, for example, the display result may include text information input by the user in the text input box, character style information corresponding to each character in the input text information, whether each character in the input text information is successfully displayed, and the like. Uploading the display result to the blockchain can ensure the safety and the fair transparency of the display result to the user. The user can download the display result from the blockchain to verify whether the display result of the implementation method of the text input box is tampered. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Therefore, the implementation method for the text input box described in the first embodiment can set a corresponding style for each input character and display the character according to the style corresponding to each character when the text input box is implemented, so that the diversified character style requirements when the text input box is implemented can be well met, and the development difficulty of the text input box is reduced. And a cursor is preset for each character in the input text information, and then the display state of each cursor is set according to the number of the characters included in the text information, so that the cursor display in the text input box is realized, and the cursor realization requirement when the text input box is realized is met. The cursor style information corresponding to each cursor is set, and then the cursor is displayed according to the display style recorded by the cursor style information when the cursor is displayed, so that the cursors corresponding to different characters can be displayed in different display styles, and the requirement of diversified cursor styles when the text input box is realized can be met. The characters can be displayed into different display styles according to different characters or different positions of the characters in the text information, and personalized display for each character in the text input box can be achieved. The cursor corresponding to the character can be displayed into different display styles according to different characters or different positions of the character in the text information, and personalized display of the cursor corresponding to each character in the text input box can be achieved. The text information input by the text input box can be filtered, so that the function of the text input box is increased, and the realized text input box is more intelligent. And the frame style and/or the background pattern of the text input box can be set according to the editing distance value, so that the similar situation of the text information input by the user and the reference text information can be prompted, the function of the text input box is increased, and the realized text input box is more intelligent.
Example two
Referring to fig. 2, fig. 2 is a schematic structural diagram of an apparatus for implementing a text input box according to an embodiment of the present invention. As shown in fig. 2, the means for implementing the text input box may include:
an obtaining module 201, configured to obtain, based on a text input control existing in a current development environment, text information that is input in a text input box by a user and includes at least one character;
a determining module 202, configured to determine character style information of each character in the text information, where the character style information is used to record a display style of the character;
and the display module 203 is used for displaying the characters in the display style recorded by the character style information of each character in the text input box so as to display the text information in the text input box.
For the specific description of the implementation apparatus of the text input box, reference may be made to the specific description of the implementation method of the text input box, which is not described in detail herein.
Therefore, when the implementation device of the text input box described in fig. 2 is implemented, a corresponding style can be set for each input character and the character is displayed according to the style corresponding to each character, so that the requirements of diversified character styles when the text input box is implemented can be well met, and the development difficulty of the text input box is reduced.
EXAMPLE III
Referring to fig. 3, fig. 3 is a schematic structural diagram of a terminal for implementing a text input box according to an embodiment of the present invention. As shown in fig. 3, the terminal for implementing the text input box may include:
a memory 301 storing executable program code;
a processor 302 coupled to the memory 301;
the processor 302 calls the executable program code stored in the memory 301 to execute the steps in the method for implementing the text input box disclosed in the embodiment of the present invention.
Example four
The embodiment of the invention discloses a computer storage medium 401, wherein a computer instruction is stored in the computer storage medium 401, and when the computer instruction is called, the computer instruction is used for executing steps in the implementation method of the text input box disclosed by the embodiment of the invention.
The above-described embodiments of the apparatus are merely illustrative, and the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above detailed description of the embodiments, those skilled in the art will clearly understand that the embodiments may be implemented by software plus a necessary general hardware platform, and may also be implemented by hardware. Based on such understanding, the above technical solutions may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, where the storage medium includes a Read-Only Memory (ROM), a Random Access Memory (RAM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), a One-time Programmable Read-Only Memory (OTPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc-Read-Only Memory (CD-ROM), or other magnetic disk memories, magnetic tape memories, magnetic disk drives, magnetic disk, Or any other medium which can be used to carry or store data and which can be read by a computer.
Finally, it should be noted that: the method, apparatus, terminal and storage medium for implementing a text entry box disclosed in the embodiments of the present invention are only preferred embodiments of the present invention, and are only used for illustrating the technical solutions of the present invention, rather than limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art; the technical solutions described in the foregoing embodiments may still be modified, or some 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 spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for implementing a text input box is characterized by comprising the following steps:
acquiring text information which is input in the text input box by a user and comprises at least one character based on a text input control existing in the current development environment;
determining character style information of each character in the text information, wherein the character style information is used for recording the display style of the character;
and displaying each character in the text input box in the display mode recorded by the character mode information of the character so as to display the text information in the text input box.
2. The method for implementing the text input box according to claim 1, wherein a corresponding cursor display tag exists for each character, and the cursor display tag is used for indicating that a cursor corresponding to the character is displayed or not displayed;
and after acquiring the text information which is input by the user in the text input box and comprises at least one character based on the existing text input control in the current development environment, the method further comprises the following steps:
setting each cursor display tag according to the number of characters included in the text information;
judging whether the cursor display label corresponding to each character is used for representing cursor display corresponding to the character or not;
when the cursor display label corresponding to the character is judged to be used for indicating cursor display corresponding to the character, displaying a cursor corresponding to the character in the text input box;
and when the cursor display label corresponding to the character is judged to be used for indicating that the cursor corresponding to the character is not displayed, not displaying the cursor corresponding to the character in the text input box.
3. The method for implementing a text input box according to claim 2, wherein each character further has corresponding cursor style information, and the cursor style information is used for recording a display style of a cursor corresponding to the character;
and after acquiring the text information which is input by the user in the text input box and comprises at least one character based on the existing text input control in the current development environment, the method further comprises the following steps:
determining cursor style information of each character in the text information;
and when the cursor display label corresponding to the character is judged to be used for indicating cursor display corresponding to the character, displaying a cursor corresponding to the character in the text input box, wherein the method comprises the following steps:
and when the cursor display label corresponding to the character is judged to be used for representing cursor display corresponding to the character, displaying the cursor corresponding to the character in the display mode recorded by the cursor mode information corresponding to the character in the text input box.
4. The method for implementing a text input box according to any one of claims 1-3, wherein the determining character style information of each character in the text information comprises:
according to each character in the text message, screening target first character style information from a predetermined first character style information set to serve as the character style information of the character, wherein the first character style information set comprises a plurality of first character style information, and each first character style information has a corresponding character; alternatively, the first and second electrodes may be,
determining first text position information corresponding to each character in the text information according to the position of each character in the text information;
and screening target second character style information from a predetermined second character style information set according to the first text position information of each character to serve as the character style information of the character, wherein the second character style information set comprises a plurality of second character style information, and each second character style information has corresponding first text position information.
5. The method for implementing a text input box according to claim 3, wherein the determining cursor style information of each character in the text information comprises:
according to each character in the text information, screening target first cursor style information from a predetermined first cursor style information set to serve as cursor style information of the character, wherein the first cursor style information set comprises a plurality of pieces of first cursor style information, and each piece of first cursor style information has a corresponding character; alternatively, the first and second electrodes may be,
determining second text position information corresponding to each character according to the position of each character in the text information;
and according to the second text position information of each character, screening target second cursor style information from a predetermined second cursor style information set to serve as the cursor style information of the character, wherein the second cursor style information set comprises a plurality of pieces of second cursor style information, and each piece of second cursor style information has corresponding second text position information.
6. The method for implementing the text input box according to claim 1, wherein the obtaining of the text information including at least one character input by the user in the text input box based on the existing text input control in the current development environment further comprises:
acquiring a character type corresponding to the text information;
judging whether a target character which does not belong to the character type exists in the text information or not;
and when the target character exists in the text information, deleting the target character from the text information, and triggering and executing the operation of determining the character style information of each character in the text information.
7. The method for implementing the text input box according to claim 1, wherein after acquiring the text information including at least one character input by the user in the text input box based on the existing text input control in the current development environment, the method further comprises:
acquiring reference text information corresponding to the text information;
calculating an edit distance value between the text information and the reference text information based on a predetermined edit distance algorithm;
and setting a frame style and/or a background pattern of the text input box according to the editing distance value.
8. An apparatus for implementing a text input box, the apparatus comprising:
the acquisition module is used for acquiring text information which is input in the text input box by a user and comprises at least one character based on the existing text input control in the current development environment;
the determining module is used for determining character style information of each character in the text information, and the character style information is used for recording the display style of the character;
and the display module is used for displaying the character in the display style recorded by the character style information of each character in the text input box so as to display the text information in the text input box.
9. A terminal for implementing a text input box, the terminal comprising:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the method for implementing the text input box according to any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements a method of implementing a text input box according to any one of claims 1 to 7.
CN202011502725.2A 2020-12-18 2020-12-18 Method, device, terminal and storage medium for implementing text input box Pending CN112612450A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011502725.2A CN112612450A (en) 2020-12-18 2020-12-18 Method, device, terminal and storage medium for implementing text input box

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011502725.2A CN112612450A (en) 2020-12-18 2020-12-18 Method, device, terminal and storage medium for implementing text input box

Publications (1)

Publication Number Publication Date
CN112612450A true CN112612450A (en) 2021-04-06

Family

ID=75240883

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011502725.2A Pending CN112612450A (en) 2020-12-18 2020-12-18 Method, device, terminal and storage medium for implementing text input box

Country Status (1)

Country Link
CN (1) CN112612450A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023045920A1 (en) * 2021-09-24 2023-03-30 维沃移动通信有限公司 Text display method and text display apparatus

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103970721A (en) * 2013-02-05 2014-08-06 腾讯科技(深圳)有限公司 Text content display method, text content display system, mobile terminal and cloud typesetting server
CN104462047A (en) * 2013-09-16 2015-03-25 北大方正集团有限公司 Typesetting method and device for electronic documents
CN104516621A (en) * 2013-09-27 2015-04-15 北京新媒传信科技有限公司 Cursor display method and device
CN109885241A (en) * 2019-01-16 2019-06-14 平安普惠企业管理有限公司 Dummy keyboard generation method, server and computer readable storage medium
CN110456919A (en) * 2018-05-07 2019-11-15 北京搜狗科技发展有限公司 Data processing method, device and the device for data processing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103970721A (en) * 2013-02-05 2014-08-06 腾讯科技(深圳)有限公司 Text content display method, text content display system, mobile terminal and cloud typesetting server
CN104462047A (en) * 2013-09-16 2015-03-25 北大方正集团有限公司 Typesetting method and device for electronic documents
CN104516621A (en) * 2013-09-27 2015-04-15 北京新媒传信科技有限公司 Cursor display method and device
CN110456919A (en) * 2018-05-07 2019-11-15 北京搜狗科技发展有限公司 Data processing method, device and the device for data processing
CN109885241A (en) * 2019-01-16 2019-06-14 平安普惠企业管理有限公司 Dummy keyboard generation method, server and computer readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023045920A1 (en) * 2021-09-24 2023-03-30 维沃移动通信有限公司 Text display method and text display apparatus

Similar Documents

Publication Publication Date Title
CA1227883A (en) Terminal for writing programs used by a programmable automaton
CN111984902A (en) Visual page configuration method, system, computer equipment and storage medium
CN111666740A (en) Flow chart generation method and device, computer equipment and storage medium
CN109787957A (en) The configuration method and relevant apparatus of configuration file
CN112612450A (en) Method, device, terminal and storage medium for implementing text input box
US20060143138A1 (en) Password input method
CN114118681A (en) Expert selection method and device
CN108363574A (en) Front end method for customizing, device, terminal device and storage medium based on SDK
CN105335645A (en) Verification method and apparatus for picture verification code
CN109344335B (en) Content recommendation method and electronic equipment
CN107423204A (en) Processing method, device and the terminal of the Operation Log of application program
CN116185853A (en) Code verification method and device
CN109815635A (en) A kind of boiler main fuel trip automated design system and method
CN113065323B (en) Method, device and equipment for importing contract template data and storage medium
CN113609823A (en) Method and device for editing questionnaire logic, terminal equipment and storage medium
CN114398226A (en) Network asset report generation method and device
CN110221952B (en) Service data processing method and device and service data processing system
CN114038460A (en) Voice instruction recommendation method and device and electronic equipment
CN113934486A (en) Method and device for editing and rendering user interface component in real time
CN112925868A (en) Method, device and equipment for realizing address input assembly and storage medium
CN112348403A (en) Wind control model construction method and device and electronic equipment
CN117065338A (en) Chess face prompting method, related device, equipment and storage medium
CN106169158A (en) A kind of finance account assets information analysis and Control system and method
CN112817499B (en) Schedule display method and device, storage medium and electronic equipment
CN116166702B (en) Data storage method of payment management system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination