CN104461054A - String length limited input device and string length limited input method - Google Patents

String length limited input device and string length limited input method Download PDF

Info

Publication number
CN104461054A
CN104461054A CN201410779699.6A CN201410779699A CN104461054A CN 104461054 A CN104461054 A CN 104461054A CN 201410779699 A CN201410779699 A CN 201410779699A CN 104461054 A CN104461054 A CN 104461054A
Authority
CN
China
Prior art keywords
input control
character
length
control interface
current
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.)
Granted
Application number
CN201410779699.6A
Other languages
Chinese (zh)
Other versions
CN104461054B (en
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.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies 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 Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN201410779699.6A priority Critical patent/CN104461054B/en
Publication of CN104461054A publication Critical patent/CN104461054A/en
Application granted granted Critical
Publication of CN104461054B publication Critical patent/CN104461054B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods

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

The invention relates to a string length limited input device and a string length limited input method. The method includes: enabling an input widget to call a delegate method for acquiring input information, and judging the type of the input information; if the input information is in a character key type, displaying the input information on a preselection input widget interface, and returning to the step of input information acquisition; if the input information is in an enter key type, enabling character strings in the preselection input widget interface to be displayed in a confirm input widget interface, acquiring total length of characters in the confirm input widget interface, and judging whether the total length of the characters is larger than a preset limited length value or not; if yes, cutting out a character string in length accordant with the preset limited length value, displaying the cut-out character string in the confirm input widget interface, and finishing; otherwise, finishing. By the string length limited input device and a string length limited input method, the technical problem that lengths of the character strings in the confirm input widget interface cannot be accurately limited in an IOS system is solved, and accuracy in limitation on lengths of the character strings in the confirm input widget interface is realized.

Description

A kind of input media of restricted character string length and method
Technical field
The present invention relates to field of computer technology, particularly a kind of input media of restricted character string length and method.
Background technology
IOS system is the operating system of the handheld device developed by Apple.Along with the development of Apple, IOS system is also in continuous renewal.At present, IOS system obtains the information of user's input by input control, input control is the encapsulation to data message and method, input control has oneself attribute and method, the data message in control interfaces can be obtained according to the attribute of self, the function with man-machine interaction can be realized according to the method for self.From IOS7 system, when input control gets the character data information of user's input, input control calls principal method (shouldChangeCharactersInRange) and limits string length, and specific implementation process is as follows:
Wherein, the input control of the current acquisition user's input information of textField Parametric Representation; Range Parametric Representation is about to the scope of the character string be replaced, have two attribute location, length, location are index positions, represent the reference position being about to the character string be replaced, length is the length representing the character string being about to be replaced; String parameter is used for obtaining user's input information, and when getting user's input information, current input control calls principal method (shouldChangeCharactersInRange) and adds up string length in input control interface.
Those skilled in the art are realizing finding in process of the present invention: at present, in IOS system, when input control passes through string parameter acquiring to user's input information under spelling input method, input control will call above-mentioned principal method statistics preliminary election input control interface and confirm the character string total length in input control interface.But, when input control gets an English character, input control will call above-mentioned principal method statistics preliminary election input control interface and confirm the character string total length in input control interface, so just there will be and in fact confirm that the string length in input control interface does not also exceed limited length value, but preliminary election input control interface has exceeded the situation of limited length value with the character string total length confirmed in input control interface, this situation can cause user to continue input character, and again cannot revise the statistics of character length.
Summary of the invention
The invention solves in prior art the technical matters that accurately can not limit the string length confirmed in input control interface under IOS system.
The invention provides a kind of method of restricted character string length, comprising:
Step s1: input control calls principal method and obtains current input information, when getting described current input information, judge the type of described current input information, if the type of described current input information is character keys type, then perform step s2, if the type of described current input information is enter key type, then perform step s5, if the type of described current input information is other function key types, then return step s1 after performing corresponding operating;
Step s2: described input control is according to being obtained current markers character length by the character string of system marks in preliminary election input control interface, current character total length is obtained according to the character string be presented in preliminary election input control interface and the character string be presented in confirmation input control interface, current input character length is obtained according to described current input information, according to described current markers character length, described current character total length and described current input character length, obtain current limited length fiducial value;
Step s3: described input control, according to described current limited length fiducial value, judges whether to show described current input information, if so, then performs step s4, otherwise, return step s1;
Step s4: described input control shows described current input information in preliminary election input control interface, returns step s1;
Step s5: the character string display be presented in preliminary election input control interface is confirming in input control interface by described input control, obtain the current character total length being presented at and confirming in input control interface, be presented at described in judgement and confirm whether the current character total length in input control interface is greater than default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of described default limited length value, in confirmation input control interface, show the character string be truncated to, terminate; Otherwise, terminate.
The invention provides a kind of input media of restricted character string length, comprising:
First acquisition module, obtaining current input information for calling principal method, triggering the first judge module;
First judge module, for judging the type of described current input information, when the type of described current input information is character keys type, trigger the second acquisition module, when the type of described current input information is enter key type, trigger the first display module, when the type of described current input information is other function key types, trigger the first processing module;
First processing module, for when described first judge module judges that the type of described current input information is other function key types, performs corresponding operating, triggers the first acquisition module;
Second acquisition module, for according to being obtained current markers character length by the character string of system marks in preliminary election input control interface, current character total length is obtained according to the character string be presented in preliminary election input control interface and the character string be presented in confirmation input control interface, current input character length is obtained according to described current input information, according to described current markers character length, described current character total length and described current input character length, obtain current limited length fiducial value, trigger the second judge module;
Second judge module, for judging whether the second display module can show described current input information according to described current limited length fiducial value, if so, then triggers the second display module; Otherwise, trigger the first acquisition module;
Second display module, for showing described current input information in preliminary election input control interface, triggers the first acquisition module;
First display module, is confirming, in input control interface, to trigger the 3rd acquisition module for the character string display that will be presented in preliminary election input control interface;
3rd acquisition module, for obtaining the current character total length being presented at and confirming in input control interface, triggers the 3rd judge module;
For being presented at described in judging, 3rd judge module, confirms whether the current character total length in input control interface is greater than default limited length value, if so, then triggers the first interception module; Otherwise, terminate;
First interception module, for from confirming the text reference position at input control interface, intercepted length is the character string of described default limited length value, triggers the 3rd display module;
3rd display module, for showing the character string be truncated in confirmation input control interface.
The invention has the beneficial effects as follows: the input media and the method that the invention provides a kind of restricted character string length, achieve accurately restriction and confirm the technique effect of the string length in input control interface.
Accompanying drawing explanation
The process flow diagram of the method for a kind of restricted character string length that Fig. 1 provides for the embodiment of the present invention 1;
The process flow diagram of the method for a kind of restricted character string length that Fig. 2 provides for the embodiment of the present invention 3;
The structure drawing of device of the input media of a kind of restricted character string length that Fig. 3 provides for the embodiment of the present invention 5.
Embodiment
Below in conjunction with accompanying drawing of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only a part of embodiment of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those skilled in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
It should be noted that, in the present invention, wait acknowledge input character refer to be presented in preliminary election input control interface by the character string of system marks, wait for user select confirm input, can be, but not limited to English character, numerical character, special character.
Confirm the character of input refer to be presented at confirm in input control interface not by the character string of system marks, can be, but not limited to Chinese character, numerical character, English character, special character.
Candidate characters refers to that system is presented at the character that the waits for user selection of candidate characters hurdle is used for replacing the character string that wait acknowledge inputs, and can be, but not limited to Chinese character, numerical character, English character, special character.
Association's character is when system gets the information of the character string that user inputs with certain character replacement wait acknowledge in candidate characters hurdle, the character that the user that system is associated may input, association's character is presented in candidate characters hurdle, can be, but not limited to be Chinese character, numerical character, English character, special character.
Such as, when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein, " ni hao " is labeled, information in candidate characters hurdle is " hello ", " you " " mud ", characters such as " nihao ", system wait user selects " the ni hao " that substitute with certain character in candidate characters hurdle in preliminary election input control interface, wherein, " ni hao " in preliminary election input control interface is the character of wait acknowledge input, confirm that " Zhang San " in input control interface is the character confirming input, information " hello " in candidate characters hurdle, " you " " mud ", characters such as " nihaon " is all candidate characters, when " hello " that system gets in user's candidate characters replaces the information of " nihao " that be labeled in preliminary election input control interface, confirm that the character string in input control interface is " hello for Zhang San ", information in candidate characters hurdle becomes character " ", now, confirm " hello for Zhang San " in control interfaces, it is the character confirming input, in candidate characters hurdle, character " " is the character that system goes out according to " hello " association that user has just inputted, character " " is association's character.
Embodiment 1
The embodiment of the present invention 1 provides a kind of specific implementation process of method of restricted character string length, performs following steps, as shown in Figure 1:
Step 101: input control accepts the triggering of input cursor, at display interface display soft keyboard;
Step 102: input control calls principal method and obtains current input information, judge the type of the current input information got, if the type of the current input information got is character keys type, then perform step 103, if the type of the current input information got is enter key type, then perform step 104, if the type of the current input information got is other function key types, then perform corresponding operating, return step 102;
Particularly, input control obtains current input information according to first parameter (string) of principal method (shouldChangeCharactersInRange), input control judges the type of current input information according to the information of the first parameter, if the first parameter is character key information, then judge that current input information type is character keys type, if the first parameter is enter key information, then judge that current input information type is enter key type, if the first parameter is other function key information, then judge that current input information type is other function key types.
Wherein, character key information can be numerical character key information, English character key information, space character key information, punctuation character key information, expression character key information.
Other function key information refer to the key information outside character key information in soft keyboard, enter key information, comprise delete key information, shift information etc.
In this step, if the type of the current input information got is delete key type, input control deletes the first character before the input cursor position in preliminary election input control interface or confirmation input control interface, returns step 102.
Such as: when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein, " ni hao " is labeled, input cursor is after " o ", input control deletes the character " o " in preliminary election input control interface, and now confirm that the character string in input control interface is " Zhang San ", the character string in preliminary election input control interface is " ni ha ".
When confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, if input cursor is after " three ", before first " you ", input control delete character " three ", now confirms that the character string in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness you well happy m ".
Step 103: input control, at preliminary election input control interface display current input information, returns step 102;
Such as, when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, now, input control shows " n " in preliminary election input control interface, now, confirm that the character string in input control interface is " Zhang San ", the character string in preliminary election input control interface is " n ".
When confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein " ni hao " is labeled, when input control get character keys type information as English character " n " perform to this step time, input control shows " n " in preliminary election input control interface, now, confirm that the character string in input control interface is " Zhang San ", character string in preliminary election input control interface is " ni hao n ", and wherein " ni hao n " is labeled.
In the present embodiment, whenever input control call principal method get input information time, will according to the method described in step 102, perform corresponding operating.
It should be noted that, based on the characteristic of IOS system, under the spelling input method that IOS system carries, candidate characters cannot be chosen to be the message of the character confirming input by input control by the first parameter acquiring user.When system get when user selects candidate characters to replace the message of character of wait acknowledge input or the message of input association character time or get user by pasting boards input character message when system time, system is directly confirming to show in input control interface candidate characters that user selects to input or is associating character or derive from the character of pasting boards input, in this case, input control cannot according to the first parameter acquiring to these information.
Such as: when confirming that the character string in input control interface be " Zhang San you good hello your good hello your good hello your good hello your good hello your good hello happiness ", when character string in preliminary election input control interface is " ni ha ", wherein, " ni ha " is labeled, when input control get character keys type information as English character " o " perform to this step time, input control shows " o " in preliminary election input control interface, now, the character string confirming in input control interface be " Zhang San you good hello your good hello your good hello your good hello your good hello your good happiness ", character string in preliminary election input control interface is " ni hao ", wherein " ni hao " is labeled.Now, if system get you in user's selection candidate characters replace wait acknowledge to input well character " ni hao ", system is in confirmation input control interface display " hello ", now, the character string confirming in input control interface be " hello for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", character string in preliminary election input control interface is empty, the message that input control cannot be replaced by candidate characters " hello " to the tab character " ni hao " in preliminary election input control interface by the first parameter acquiring, now, if system gets the message that user continues to select input association's character " ", system is in confirmation input control interface display " ", now, the character string confirming in input control interface be " how do you do for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", input control cannot by the input message of the first parameter acquiring to association's character " ".
When confirming that the character string in input control interface be " Zhang San you good hello your good hello your good hello your good hello your good hello your good hello happiness ", when character string in preliminary election input control interface is empty, now, if system gets the message of user by pasting boards input " you good happy m ", system is at confirmation input control interface display " you good happy m ", now, the character string confirming in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", character string in preliminary election input control interface is empty, input control cannot by the input message of the first parameter acquiring to association's character " ".
Step 104: input control packs up soft keyboard, is presented at the current string in preliminary election input control interface and confirms in input control interface;
Particularly, input control packs up soft keyboard, by the Charactes Display of the wait acknowledge input in preliminary election input control interface in confirmation input control interface.
Such as: when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein, " ni hao " is labeled, when input control gets enter key type, input control packs up soft keyboard, " ni hao " is shown to and confirms in input control interface, now confirm that the character string in input control interface is " Zhang San ni hao ", the character string in preliminary election input control interface is empty.
Step 105: input control obtains the current character total length confirmed in input control interface, judge whether current character total length is greater than default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, show in confirmation input control interface and intercept character string, terminate; Otherwise, terminate.
Particularly, input control obtains the current character total length being presented at and confirming in input control interface according to the text size attribute of the current string confirmed in input control interface, judge to be presented at and confirm whether the current character total length in input control interface is greater than default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, shows and intercepts character string, terminate in confirmation input control interface; Otherwise, terminate.
In the present embodiment, preferably, presetting limited length value is 30, represents that input control allows the maximum length being presented at the character string confirmed in input control interface to be 30.
In the present embodiment, confirm that the text reference position in input control interface is 0.
Such as: when confirming that the character string in input control interface is " Zhang San ni hao ", when character string in preliminary election input control interface is empty, input control obtains according to the text size attribute of the current string confirmed in input control interface and confirms that the current character total length in input control interface is 8, judge that 8 are less than default limited length fiducial value, terminate.
When confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, input control obtains according to the text size attribute of the current string confirmed in input control interface and confirms that the current character total length in input control interface is 33, judge that 33 are greater than default limited length fiducial value, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, character string is intercepted in confirmation input control interface display, namely confirmation input control interface display " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ", terminate.
In the present embodiment, input control calls principal method and obtains input information, when the first parameter acquiring by principal method is to current input information, judge current input information type, if character keys type, then at preliminary election input control interface display current input information, return and obtain input information Step; If enter key type, then the current string in preliminary election input control interface is presented at and confirms in input control interface by input control, obtain the current character total length being presented at and confirming in input control interface, judge to be presented at and confirm whether the current character total length in input control interface is greater than default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, show in confirmation input control interface and intercept character string, terminate; Otherwise, terminate, if other function key types, perform corresponding operating, return and obtain input information Step.The technical program accurately can not limit the technical matters of the string length confirmed in input control interface under overcoming IOS system, achieve the accurate restriction confirming the string length in input control interface under IOS system.
Embodiment 2
The embodiment of the present invention 2 provides a kind of specific implementation process of method of restricted character string length, performs following steps:
Step 201: input control accepts the triggering of input cursor, at display interface display soft keyboard;
Step 202: input control calls principal method and obtains current input information, judge the type of the current input information got, if the type of the current input information got is character keys type, then perform step 203, if the type of the current input information got is enter key type, then perform step 204, if the type of the current input information got is other function key types, then perform corresponding operating, return step 202;
Particularly, input control obtains current input information according to first parameter (string) of principal method (shouldChangeCharactersInRange), input control judges the type of current input information according to the information of the first parameter, if the first parameter is character key information, then judge that current input information type is character keys type, if the first parameter is enter key information, then judge that current input information type is enter key type, if the first parameter is other function key information, then judge that current input information type is other function key types.
Wherein, character key information can be numerical character key information, English character key information, space character key information, punctuation character key information, expression character key information.
Other function key information refer to the key information outside character key information in soft keyboard, enter key information, comprise delete key information, shift information etc.
In this step, if the type of the current input information got is delete key type, input control performs step a1,
Step a1: input control, according to the current significant character length of the second parameter acquiring, obtains current limited length fiducial value according to current significant character length;
Particularly, when input control gets delete key type information, system is according to the position at input cursor place and the character be labeled, the character string obtaining in preliminary election input control interface or confirm in input control interface is about to the character length that the reference position that changes and character string are about to change, using in preliminary election input control interface or the character string confirming in input control interface be about to the reference position that changes to pass to principal method as index length the second parameter (range) as index-location values and the character length that will be about to change, input control obtains index-location values according to the position attribution of the second parameter, input control obtains current significant character length according to index-location values, using current significant character length as current limited length fiducial value,
Input control obtains current significant character length according to index-location values, specifically comprise: input control is from confirming the text reference position at input control interface, the character string that intercepted length is identical with index-location values, using the length of character string that gets as current significant character length, using current significant character length as current limited length fiducial value;
Or input control obtains current significant character length according to index-location values, specifically comprises: using index-location values as current significant character length, using current significant character length as current limited length fiducial value;
In this enforcement, confirm that the text reference position in input control interface is 0.
Such as: when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, if input cursor is after " three ", when input control get delete key type information perform this step time, system gets and confirms that the reference position that the character string in input control interface is about to change is 1, the string length being about to change is 1, the second parameter of input control is passed to respectively using 1 as index-location values and index length, input control is 1 according to the second parameter acquiring index-location values, from confirming the text reference position of inputting interface, intercepted length is the character string of 1, the length that the character obtaining intercepting " is opened " is 1, namely current significant character length is 1, namely current limited length fiducial value is 1.If input cursor moves between " opening " and " three ", when input control get delete key type information perform this step time, the reference position that the system character string got in input control interface is about to change is 0, the character length being about to reduce is 1, index position and index length are passed to the second parameter by system, input control is according to the beginning from the text of location confirmation inputting interface of the second parameter, intercepted length is the character string of 0, obtaining current significant character length according to the character string got is 0, and namely current limited length fiducial value is 0.
When confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", when input cursor is after " o ", when input control get delete key type information perform this step time, the reference position that character string in system acquisition preliminary election input control interface is about to change is 2, the character length being about to reduce is 6, index-location values and index length are passed to the second parameter by system, input control according to the second parameter from confirm inputting interface text reference position, intercepted length is the character string of 2, namely " Zhang San " is intercepted, the character length obtaining " Zhang San " is 2, by the length 2 of " Zhang San " character string as current significant character length, namely current significant character length is 2, namely current limited length fiducial value is 2.
When confirming that the character string at input control interface be " hello for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", when character string in preliminary election input control interface is empty, after input cursor in the end " good ", when input control get delete key type information perform this step time, system obtains and confirms that the reference position that the character string in input control interface is about to change is 29, the character length being about to reduce is 1, index-location values and index length are passed to the second parameter by system, input control according to the second parameter from confirm inputting interface text reference position, intercepted length is the character string of 29, namely intercept " Zhang San you good hello your good hello your good hello your good hello your good hello your good hello happiness you ", getting current significant character length is 29, namely current limited length fiducial value is 29.
When confirming that the character string in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, if input cursor is between " heart " and " m ", when input control get delete key type information perform this step time, index-location values and index length are passed to the second parameter by system, input control is 31 according to the second parameter acquiring index-location values, obtaining current significant character length according to index-location values is 31, namely current limited length fiducial value is 31.If delete character is after " three ", before first " you ", when input control get delete key type information perform this step time, index-location values and index length are passed to the second parameter by system, input control is 1 according to the second parameter acquiring index-location values, obtaining current significant character length according to index-location values is 1, and namely current limited length fiducial value is 1.
Step a2: input control judges whether current limited length fiducial value is greater than default limited length value, if so, then performs step a3, otherwise performs step a4;
In the present embodiment, preferably, presetting limited length value is 30, represents that input control allows the maximum length being presented at the character string confirmed in input control interface to be 30.
Such as: when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein " ni hao " is labeled, input cursor is after " o ", when input control get delete key type information perform this step time, current limited length fiducial value is 2, and input control judges that current limited length fiducial value is not more than default limited length value 30, and input control performs step a4;
When confirming that the character string at input control interface be " hello for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", when character string in preliminary election input control interface is empty, after input cursor in the end " good ", when input control get delete key type information perform this step time, current limited length fiducial value is 29, input control judges that current limited length fiducial value is not more than default limited length value 30, and input control performs step a4;
When confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, if input cursor is between " heart " and " m ", when input control get delete key type information perform this step time, current limited length fiducial value is 31, input control judges that current limited length fiducial value is greater than limited length value 30, and input control performs step a3; If input cursor is after " three ", before first " you ", when input control get delete key type information perform this step time, current limited length fiducial value is 1, input control judges that current limited length fiducial value is not more than limited length value 30, and input control performs step a4.
Step a3: input control is from the text reference position confirmed in input control interface, and intercepted length is the character string of default limited length value, confirming the character string showing intercepting in input control interface, returns step 202;
Such as: when confirming that the character string in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, input control intercepts from the text reference position confirmed in input control interface, intercepted length is the character string of 30, namely intercept " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ", confirming the character string showing intercepting in input control interface, i.e. display in confirmation input control interface " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ".
Step a4: input control deletes the first character before the input cursor position in preliminary election input control interface or confirmation input control interface, returns step 202;
Such as: when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein, " ni hao " is labeled, input cursor is after " o ", input control deletes the character " o " in preliminary election input control interface, and now confirm that the character string in input control interface is " Zhang San ", the character string in preliminary election input control interface is " ni ha ".
When confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, if input cursor is after " three ", before first " you ", input control delete character " three ", now confirms that the character string in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness you well happy m ".
Step 203: input control, at preliminary election input control interface display current input information, returns step 202;
Such as, when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, now, input control shows " n " in preliminary election input control interface, now, confirm that the character string in input control interface is " Zhang San ", the character string in preliminary election input control interface is " n ".
When confirming that the character string in input control interface is " Zhang San ", character string in preliminary election input control interface is " ni hao ", wherein " ni hao " is labeled, when input control get character keys type information as English character " n " perform to this step time, input control shows " n " in preliminary election input control interface, now, confirm that the character string in input control interface is " Zhang San ", character string in preliminary election input control interface is " ni hao n ", and wherein " ni hao n " is labeled.
In the present embodiment, when input control is by entrusting function to get input information, according to the method described in step 202, corresponding operating will be performed.
It should be noted that, based on the characteristic of IOS system, under the spelling input method that IOS system carries, candidate characters cannot be chosen to be the message of the character confirming input by input control by the first parameter acquiring user.
When system get when user selects candidate characters to replace the message of character of wait acknowledge input or the message of input association character time or get user by pasting boards input character message when system time, system is directly confirming to show in input control interface candidate characters that user selects to input or is associating character or derive from the character of pasting boards input, in this case, input control cannot according to the first parameter acquiring to these information.
Such as: when confirming that the character string in input control interface be " Zhang San you good hello your good hello your good hello your good hello your good hello your good hello happiness ", when character string in preliminary election input control interface is " ni ha ", wherein, " ni ha " is labeled, when input control get character keys type information as English character " o " perform to this step time, input control shows " o " in preliminary election input control interface, now, the character string confirming in input control interface be " Zhang San you good hello your good hello your good hello your good hello your good hello your good happiness ", character string in preliminary election input control interface is " ni hao ", wherein " ni hao " is labeled.Now, if system get you in user's selection candidate characters replace wait acknowledge to input well character " ni hao ", system is in confirmation input control interface display " hello ", now, the character string confirming in input control interface be " hello for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", character string in preliminary election input control interface is empty, the message that input control cannot be replaced by candidate characters " hello " to the tab character " ni hao " in preliminary election input control interface by the first parameter acquiring, now, if system gets the message that user continues to select input association's character " ", system is in confirmation input control interface display " ", now, the character string confirming in input control interface be " how do you do for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", input control cannot by the input message of the first parameter acquiring to association's character " ".
When confirming that the character string in input control interface be " Zhang San you good hello your good hello your good hello your good hello your good hello your good hello happiness ", character string in preliminary election input control interface is empty, now, if system gets the message of user by pasting boards input " you good happy m ", system is at confirmation input control interface display " you good happy m ", now, the character string confirming in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", character string in preliminary election input control interface is empty, input control cannot by the input message of the first parameter acquiring to association's character " ".
Step 204: input control packs up soft keyboard, is presented at the current string in preliminary election input control interface and confirms in input control interface;
Particularly, input control packs up soft keyboard, by the Charactes Display of the wait acknowledge input in preliminary election input control interface in confirmation input control interface.
Such as: when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein, " ni hao " is labeled, when input control gets enter key type, input control packs up soft keyboard, " ni hao " is shown to and confirms in input control interface, now confirm that the character string in input control interface is " Zhang San ni hao ", the character string in preliminary election input control interface is empty.
Step 205: input control obtains the current character total length confirmed in input control interface, judge whether current character total length is greater than default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, show in confirmation input control interface and intercept character string, terminate; Otherwise, terminate.
Particularly, input control obtains according to the text size attribute being presented at the current string confirmed in input control interface the current character total length being presented at and confirming in input control interface, judge to be presented at and confirm whether the current character total length in input control interface is greater than default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, show in confirmation input control interface and intercept character string, terminate; Otherwise, terminate.
Such as: when confirming that the character string in input control interface is " Zhang San ni hao ", character string in preliminary election input control interface is empty, input control obtains according to the text size attribute of the current string confirmed in input control interface and confirms that the current character total length in input control interface is 8, judge that 8 are less than default limited length fiducial value, terminate.
When confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", character string in preliminary election input control interface is empty, input control obtains according to the text size attribute of the current string confirmed in input control interface and confirms that the current character total length in input control interface is 33, judge that 33 are greater than default limited length fiducial value, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, character string is intercepted in confirmation input control interface display, namely confirmation input control interface display " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ", terminate.
In the present embodiment, input control calls principal method and obtains current input information, when by the first parameter acquiring current input information, judge current input information type, if character keys type, the character that the user then obtained in preliminary election input control interface display inputs, returns and obtains input information Step; If other function key types, then perform corresponding operating, return and obtain input information Step, when other function key types are delete key types, input control is according to the current significant character length of the second parameter acquiring, current limited length fiducial value is obtained according to current significant character length, input control judges whether current limited length fiducial value is greater than default limited length value, if, then intercept and confirm that in input control interface, length is the character string of default limited length value, otherwise execution deletion action, returns and obtains input information Step; If enter key type, then the current string in preliminary election input control interface is presented at and confirms in input control interface by input control, obtain the current character total length being presented at and confirming in input control interface, judge to be presented at and confirm whether the current character total length in input control interface is greater than default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, show in confirmation input control interface and intercept character string, terminate; Otherwise, terminate.The technical program accurately can not limit the technical matters of the string length confirmed in input control interface under overcoming IOS system, achieve the accurate restriction of the string length confirmed in input control interface, also improve the experience effect of user preferably.
Embodiment 3
The embodiment of the present invention 3 provides a kind of specific implementation process of method of restricted character string length, performs following steps, as shown in Figure 2:
Step 301: input control accepts the triggering of input cursor, at display interface display soft keyboard;
Step 302: input control calls principal method and obtains current input information, judge the type of the current input information got, if the type of the current input information got is character keys type, then perform step 303, if the type of the current input information got is enter key type, then perform step 307, if the type of the current input information got is other function key types, then perform corresponding operating, return step 302;
Particularly, input control obtains current input information according to first parameter (string) of principal method (shouldChangeCharactersInRange), input control judges the type of current input information according to the information of the first parameter, if the first parameter is character key information, then judge that current input information type is character keys type, if the first parameter is enter key information, then judge that current input information type is enter key type, if the first parameter is other function key information, then judge that current input information type is other function key types.
Wherein, character key information can be numerical character key information, English character key information, space character key information, punctuation character key information, expression character key information.
Other function key information refer to the key information outside character key information in soft keyboard, enter key information, comprise delete key information, shift information etc.
In this step, if the type of the current input information got is delete key type, input control deletes the first character before the input cursor position in preliminary election input control interface or confirmation input control interface, returns step 302;
Such as: when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein, " ni hao " is labeled, input cursor is after " o ", input control deletes the character " o " in preliminary election input control interface, and now confirm that the character string in input control interface is " Zhang San ", the character string in preliminary election input control interface is " ni ha ".
When confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, if input cursor is after " three ", before first " you ", input control delete character " three ", now confirms that the character string in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness you well happy m ".
Step 303: input control obtains tab character scope, obtains tab character according to tab character scope;
UITextRange*selectedRange=[textField markedTextRange];
Wherein, selectedRange is tab character scope;
Particularly, the method (markedTextRange) of the character range of the mark wait acknowledge of input control calling system obtains the scope of the character of wait acknowledge input in preliminary election inputting interface, using the scope that gets as tab character scope.Wherein, the method for the character range of mark wait acknowledge, is used for marking the character of wait acknowledge input in preliminary election inputting interface, returns the scope of the character of wait acknowledge input in preliminary election input control interface.
Input control gets tab character scope according to the method for the character range of mark wait acknowledge, according to tab character scope, obtains tab character;
NSString*newText=[textField textInRange:selectedRange];
Wherein, newText is tab character.
Such as, when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, input control is sky according to the character of the wait acknowledge input obtained in preliminary election input control interface of the method for the character range of mark wait acknowledge, the tab character scope got is null value, and it is null value that input control gets tab character according to the tab character scope got.
When confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein, " ni hao " is labeled, it is (2 that input control obtains tab character scope according to the method for the character range of mark wait acknowledge, 6), input control using 2 as the reference position of the first character in the character string in preliminary election input control interface, using 6 as the string length in preliminary election input control interface.Input control is from the reference position of the first character in the character string in preliminary election input control interface, and obtaining string length value is the character string of 6, and the character obtained within the scope of this is " ni hao ", namely obtains tab character " ni hao ".
Step 304: input control obtains current markers character length, obtains current character total length, obtains current input character length, obtains current limited length fiducial value according to current character total length, current input character length and current markers character length;
This step specifically comprises:
Step b1: input control obtains current markers character length, obtains current character total length, obtains current input character length;
Obtain current markers character length: [newText.length];
Obtain current character total length: [textField.text length];
Obtain the length of current input character: [string.length];
In the present embodiment, particularly, input control obtains current markers character length according to the length attribute of tab character; Input control obtains the character string be presented in preliminary election input control interface and the length sum being presented at the character string confirmed in input control interface according to the character string be presented in preliminary election input control interface and the length attribute that is presented at the character string confirmed in input control interface, using the character string be presented in preliminary election input control interface and be presented at the character string confirmed in input control interface length sum as current character total length; Input control obtains the length of the character of current input according to the first parameter length attribute of self, using the length of the character of current input that gets as current input character length.
Step b2: input control obtains current acknowledge character length according to current markers character length and current character total length;
Particularly, current character total length is deducted result that current markers character length obtains as current acknowledge character length;
Step b3: input control obtains current limited length fiducial value according to current acknowledge character length and current input character length;
Particularly, calculate current acknowledge character length and current input character length and, using the result that calculates as current limited length fiducial value;
Such as, when the character string confirming input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, it is 0 that input control obtains current markers character length according to the length attribute of tab character, obtain in preliminary election input control interface and confirm that the character string total length in input control interface is 2, namely current character total length is 2, the length obtaining the character of current input according to the first parameter length attribute is 1, namely current input character length is 1, obtaining current acknowledge character length according to current character total length and current markers character length is 2, obtaining current limited length fiducial value according to current acknowledge character length and current input character length computation is 3.
Such as, when the character string confirming input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein " ni hao " is labeled, when input control get character keys type information as English character " n " perform to this step time, it is 6 that input control obtains current markers character length according to the length attribute of tab character, obtain in preliminary election input control interface and confirm that the character string total length in input control interface is 8, namely current character total length is 8, the length obtaining the character of current input according to the first parameter length attribute is 1, namely current input character length is 1, obtaining current acknowledge character length according to current character total length and current markers character length is 2, obtaining current limited length fiducial value according to current acknowledge character length and current input character length is 3.
When confirming that the character string at input control interface be " hello for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, it is 0 that input control obtains current markers character length according to the length attribute of tab character, obtain in preliminary election input control interface and confirm that the character string total length in input control interface is 30, namely current character total length is 30, the length 1 of the character of current input is obtained according to the first parameter length attribute, namely current input character length is 1, obtaining current acknowledge character length according to current character total length and current markers character length is 30, obtaining current limited length fiducial value according to current acknowledge character length and current input character length is 31.
Step 305: input control judges whether current limited length fiducial value is greater than default limited length value, is then, returns step 302, otherwise perform step 306;
In the present embodiment, preferably, presetting limited length value is 30, represents that input control allows the maximum length being presented at the character string confirmed in input control interface to be 30.
Such as, when the character string confirming input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, current limited length fiducial value is 3, input control judges that 3 are less than 30, and input control performs step 306.
When the character string confirming input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein " ni hao " is labeled, when input control get character keys type information as English character " n " perform to this step time, current limited length fiducial value is 3, input control judges that 3 are less than 30, and input control performs step 306.
When confirming that the character string at input control interface be " hello for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, current limited length fiducial value is 31, input control judges that 31 are greater than 30, and input control returns step 302;
When confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, current limited length fiducial value is 34, and input control returns step 302.
In this step, input control before returning step 302, can also perform step c1 after judging that current limited length fiducial value is greater than default limited length value,
C1: input control is from the text reference position confirmed in input control interface, and intercepted length is the character string of default limited length value, is confirming the character string showing intercepting in input control interface;
In this enforcement, confirm that the text reference position in input control interface is 0.
Such as: when confirming that the character string at input control interface be " hello for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, current limited length fiducial value is 31, input control judges that 31 are greater than 30, input control intercepts from the text reference position in input control interface, intercepted length is the character string of 30, namely intercept " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ", confirming the character string showing intercepting in input control interface, namely show " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ",
When confirming that the character string in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, input control intercepts from the text reference position in input control interface, intercepted length is the character string of 30, namely intercept " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ", confirming the character string showing intercepting in input control interface, namely show " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ".
Step 306: input control shows the character of input in preliminary election input control interface, returns step 302;
Such as, when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, now, input control shows " n " in preliminary election input control interface, now, confirm that the character string in input control interface is " Zhang San ", the character string in preliminary election input control interface is " n ".
When confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein " ni hao " is labeled, when input control get character keys type information as English character " n " perform to this step time, input control shows " n " in preliminary election input control interface, now, confirm that the character string in input control interface is " Zhang San ", character string in preliminary election input control interface is " ni hao n ", and wherein " ni hao n " is labeled.
In the present embodiment, when input control is by entrusting function to get input information, according to the method described in step 302, corresponding operating will be performed.
It should be noted that, based on the characteristic of IOS system, under the spelling input method that IOS system carries, candidate characters cannot be chosen to be the message of the character confirming input by input control by the first parameter acquiring user.When system get when user selects candidate characters to replace the message of character of wait acknowledge input or the message of input association character time or get user by pasting boards input character message when system time, system is directly confirming to show in input control interface candidate characters that user selects to input or is associating character or derive from the character of pasting boards input, in this case, input control cannot according to the first parameter acquiring to these information.
Such as: when confirming that the character string in input control interface be " Zhang San you good hello your good hello your good hello your good hello your good hello your good hello happiness ", when character string in preliminary election input control interface is " ni ha ", wherein, " ni ha " is labeled, when input control get character keys type information as English character " o " perform to this step time, input control shows " o " in preliminary election input control interface, now, the character string confirming in input control interface be " Zhang San you good hello your good hello your good hello your good hello your good hello your good happiness ", character string in preliminary election input control interface is " ni hao ", wherein " ni hao " is labeled.Now, if system get you in user's selection candidate characters replace wait acknowledge to input well character " ni hao ", system is in confirmation input control interface display " hello ", now, the character string confirming in input control interface be " hello for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", character string in preliminary election input control interface is empty, the message that input control cannot be replaced by candidate characters " hello " to the tab character " ni hao " in preliminary election input control interface by the first parameter acquiring, now, if system gets the message that user continues to select input association's character " ", system is in confirmation input control interface display " ", now, the character string confirming in input control interface be " how do you do for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", input control cannot by the input message of the first parameter acquiring to association's character " ".
When confirming that the character string in input control interface be " Zhang San you good hello your good hello your good hello your good hello your good hello your good hello happiness ", character string in preliminary election input control interface is empty, now, if system gets the message of user by pasting boards input " you good happy m ", system is at confirmation input control interface display " you good happy m ", now, the character string confirming in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", character string in preliminary election input control interface is empty, input control cannot by the input message of the first parameter acquiring to association's character " ".
Step 307: input control packs up soft keyboard, is presented at the current string in preliminary election input control interface and confirms in input control interface;
Particularly, input control packs up soft keyboard, by the Charactes Display of the wait acknowledge input in preliminary election input control interface in confirmation input control interface.
Such as: when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein, " ni hao " is labeled, when input control gets enter key type, input control packs up soft keyboard, " ni hao " is shown to and confirms in input control interface, now confirm that the character string in input control interface is " Zhang San ni hao ", the character string in preliminary election input control interface is empty.
Step 308: input control obtains the current character total length confirmed in input control interface, judge whether current character total length is greater than default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, show in confirmation input control interface and intercept character string, terminate; Otherwise, terminate.
Particularly, input control obtains the current character total length being presented at and confirming in input control interface according to the text size attribute of the current string confirmed in input control interface, judge to be presented at and confirm whether the current character total length in input control interface is greater than default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, shows and intercepts character string, terminate in confirmation input control interface; Otherwise, terminate.
Such as: when confirming that the character string in input control interface is " Zhang San ni hao ", character string in preliminary election input control interface is empty, input control obtains according to the text size attribute of the current string confirmed in input control interface and confirms that the current character total length in input control interface is 8, judge that 8 are less than default limited length fiducial value, terminate.
When confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", character string in preliminary election input control interface is empty, input control obtains according to the text size attribute of the current string confirmed in input control interface and confirms that the current character total length in input control interface is 33, judge that 33 are greater than default limited length fiducial value, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, character string is intercepted in confirmation input control interface display, namely confirmation input control interface display " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ", terminate.
The present embodiment, input control calls principal method and obtains input information, when passing through the first parameter acquiring to current input information, judge current input information type, if character keys type, then input control obtains current acknowledge character length and current input character length, input control obtains current limited length fiducial value according to current acknowledge character length and current input character length, input control judges whether current limited length fiducial value is greater than default limited length value, if, then intercept from the text reference position confirmed in input control interface, intercepted length is the character string of default limited length value, confirming the character string showing intercepting in input control interface, return and obtain input information Step, otherwise at the current input information that preliminary election input control interface display obtains, return and obtain input information Step, if other function key types, after then performing corresponding operating, the input information Step to be obtained such as to return, if enter key type, then the current string in preliminary election input control interface is presented at and confirms in input control interface by input control, obtain the current character total length being presented at and confirming in input control interface, judge to be presented at and confirm whether the current character total length in input control interface is greater than default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, show in confirmation input control interface and intercept character string, terminate, otherwise, terminate.The technical program accurately can not limit the technical matters of the string length confirmed in input control interface under overcoming IOS system, achieve the accurate restriction of the string length confirmed in input control interface, also improve the experience effect of user preferably.
Embodiment 4
The embodiment of the present invention 4 provides a kind of specific implementation process of method of restricted character string length, performs following steps:
Step 401: input control accepts the triggering of input cursor, at display interface display soft keyboard;
Step 402: input control calls principal method and obtains current input information, judge the type of the current input information got, if the type of the current input information got is character keys type, then perform step 403, if the type of the current input information got is enter key type, then perform step 407, if the type of the current input information got is other function key types, then perform corresponding operating, return step 402;
Particularly, input control obtains current input information according to first parameter (string) of principal method (shouldChangeCharactersInRange), input control judges the type of current input information according to the information of the first parameter, if the first parameter is character key information, then judge that current input information type is character keys type, if the first parameter is enter key information, then judge that current input information type is enter key type, if the first parameter is other function key information, then judge that current input information type is other function key types.
Wherein, character key information can be numerical character key information, English character key information, space character key information, punctuation character key information, expression character key information.
Other function key information refer to the key information outside character key information in soft keyboard, enter key information, comprise delete key information, shift information etc.
In this step, if the type of the current input information got is delete key type, input control performs steps d 1,
Steps d 1: input control, according to the current significant character length of the second parameter acquiring of principal method, obtains current limited length fiducial value according to current significant character length;
Particularly, when input control gets delete key type information, system is according to the position at input cursor place and the character be labeled, the character string obtaining preliminary election input control interface or confirm in input control interface is about to the character length that the reference position that changes and character string are about to change, using in preliminary election input control interface or the character string confirming in input control interface be about to the reference position that changes and pass to second parameter (range) of entrusting function as index-location values and the character length that will be about to change as index length, input control obtains index-location values according to the position attribution of the second parameter, input control obtains current significant character length according to index-location values, using current significant character length as limited length fiducial value,
Input control obtains current significant character length according to index-location values, specifically comprise: input control intercepts from confirming the text reference position at input control interface, the character string that intercepted length is identical with index-location values, using the length of character string that gets as current significant character length, using current significant character length as current limited length fiducial value;
Or input control obtains current significant character length according to index-location values, specifically comprises: using index-location values as current significant character length, using current significant character length as current limited length fiducial value;
Such as: when confirming that the character string in input control interface is " Zhang San ", character is labeled for time empty in preliminary election input control interface, if input cursor is after " three ", when input control get delete key type information perform this step time, system gets and confirms that the reference position that the character string in input control interface is about to change is 1, the string length being about to change is 1, the second parameter of input control is passed to respectively using 1 as index-location values and index length, input control is 1 according to the second parameter acquiring index-location values, intercept from position 0, intercepted length is the character string of 1, the length that the character obtaining intercepting " is opened " is 1, namely significant character length is 1, namely limited length fiducial value is 1.If input cursor moves between " opening " and " three ", when input control get delete key type information perform this step time, system gets and confirms that the reference position that the character string in input control interface is about to change is 0, the character length being about to reduce is 1, index position and index length are passed to the second parameter by system, input control intercepts from position 0 according to the second parameter, intercepted length is the character string of 0, obtaining current significant character length according to the character string got is 0, and namely current limited length fiducial value is 0.
When confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein, " ni hao " is labeled, when input cursor is after " o ", when input control get delete key type information perform this step time, the reference position that character string in system acquisition preliminary election input control interface is about to change is 2, the character length being about to reduce is 6, index-location values and index length are passed to the second parameter by system, input control is according to the beginning from confirming the text of inputting interface of the second parameter, intercepted length is the character string of 2, namely " Zhang San " is intercepted, the character length obtaining " Zhang San " is 2, by the length 2 of " Zhang San " character string as current significant character length, namely current significant character length is 2, namely current limited length fiducial value is 2.
When confirming that the character string at input control interface be " hello for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", when character string in preliminary election input control interface is empty, after input cursor in the end " good ", when input control get delete key type information perform this step time, system obtains and confirms that the reference position that the character string in input control interface is about to change is 29, the character length being about to reduce is 1, index-location values and index length are passed to the second parameter by system, input control according to the second parameter from confirm inputting interface text reference position, intercepted length is the character string of 29, namely intercept " Zhang San you good hello your good hello your good hello your good hello your good hello your good hello happiness you ", getting current significant character length is 29, namely current limited length fiducial value is 29.
When confirming that the character string in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, if input cursor is between " heart " and " m ", when input control get delete key type information perform this step time, index-location values and index length are passed to the second parameter by system, input control is 31 according to the second parameter acquiring index-location values, obtaining current significant character length according to index-location values is 31, namely current limited length fiducial value is 31.If delete character is after " three ", before first " you ", when input control get delete key type information perform this step time, index-location values and index length are passed to the second parameter by system, input control is 1 according to the second parameter acquiring index-location values, obtaining current significant character length according to index-location values is 1, and namely current limited length fiducial value is 1.
Steps d 2: input control judges whether current limited length fiducial value is greater than default limited length value, if so, then performs steps d 3, otherwise performs steps d 4;
In the present embodiment, preferably, presetting limited length value is 30, represents that input control allows the maximum length being presented at the character string confirmed in input control interface to be 30.
Such as: when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein " ni hao " is labeled, input cursor is after " o ", when input control get delete key type information perform this step time, current limited length fiducial value is 2, and input control judges that current limited length fiducial value is not more than default limited length value 30, and input control performs steps d 4;
When confirming that the character string at input control interface be " hello for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", when character string in preliminary election input control interface is empty, after input cursor in the end " good ", when input control get delete key type information perform this step time, current limited length fiducial value is 29, input control judges that current limited length fiducial value is not more than default limited length value 30, and input control performs steps d 4;
When confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, if input cursor is between " heart " and " m ", when input control get delete key type information perform this step time, current limited length fiducial value is 31, input control judges that current limited length fiducial value is greater than limited length value 30, and input control performs steps d 3; If input cursor is after " three ", before first " you ", when input control get delete key type information perform this step time, current limited length fiducial value is 1, input control judges that current limited length fiducial value is not more than limited length value 30, and input control performs steps d 4.
Steps d 3: input control intercepts from the text reference position confirmed in input control interface, and intercepted length is the character string of default limited length value, confirming the character string showing intercepting in input control interface, returns step 402;
In this enforcement, confirm that the text reference position in input control interface is 0.
Such as: when confirming that the character string in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, input control intercepts from the text reference position confirmed in input control interface, intercepted length is the character string of 30, namely intercept " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ", confirming the character string showing intercepting in input control interface, i.e. display in confirmation input control interface " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ".
Steps d 4: input control deletes the first character before the input cursor position in preliminary election input control interface or confirmation input control interface, returns step 402;
Such as: when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein, " ni hao " is labeled, input cursor is after " o ", input control deletes the character " o " in preliminary election input control interface, and now confirm that the character string in input control interface is " Zhang San ", the character string in preliminary election input control interface is " ni ha ".
When confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, if input cursor is after " three ", before first " you ", input control delete character " three ", now confirms that the character string in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness you well happy m ".
Step 403: obtain tab character scope, obtains tab character according to tab character scope;
UITextRange*selectedRange=[textField markedTextRange];
Wherein, selectedRange is tab character scope;
Particularly, the method (markedTextRange) of the character range of the mark wait acknowledge of input control calling system obtains the scope of the character of wait acknowledge input in the preliminary election inputting interface of input control, using the scope that gets as tab character scope.Wherein, the method for character range of mark wait acknowledge, is used for marking the character of wait acknowledge input in the preliminary election inputting interface of input control, returns the scope of the character of wait acknowledge input in preliminary election input control interface.
Input control gets tab character scope according to the method for the character range of mark wait acknowledge, according to tab character scope, obtains tab character;
NSString*newText=[textField textInRange:selectedRange];
Wherein, newText is tab character.
Such as, when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, input control is sky according to the character of the wait acknowledge input obtained in preliminary election input control interface of the method for the character range of mark wait acknowledge, the tab character scope got is null value, and it is null value that input control gets tab character according to the tab character scope got.
When confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein, " ni hao " is labeled, it is (2 that input control obtains tab character scope according to the method for the character range of mark wait acknowledge, 6), input control using 2 as the reference position of the first character in the character string in preliminary election input control interface, using 6 as the string length in preliminary election input control interface.Input control is from the reference position of the first character in the character string in preliminary election input control interface, and obtaining string length value is the character string of 6, and the character obtained within the scope of this is " ni hao ", namely obtains tab character " ni hao ".
Step 404: input control obtains current markers character length, obtains current character total length, obtains current input character length, obtains current limited length fiducial value according to current character total length, current input character length and current markers character length;
Step e1: input control obtains current markers character length, obtains current character total length, obtains current input character length;
Obtain current markers character length: [newText.length];
Obtain current character total length: [textField.text length];
Obtain the length of current input character: [string.length];
In the present embodiment, particularly, input control obtains current markers character length according to the length attribute of tab character; Input control obtains the character string be presented in preliminary election input control interface and the length sum being presented at the character string confirmed in input control interface according to the character string be presented in preliminary election input control interface and the length attribute that is presented at the character string confirmed in input control interface, using the character string be presented in preliminary election input control interface and be presented at the character string confirmed in input control interface length sum as current character total length; Input control obtains the length of the character of current input according to the first parameter length attribute of self, using the length of the character of current input that gets as current input character length.
Step e2: input control obtains current acknowledge character length according to current markers character length and current character total length;
Particularly, current character total length is deducted result that current markers character length obtains as current acknowledge character length;
Step e3: input control obtains current limited length fiducial value according to current acknowledge character length and current input character length;
Particularly, calculate current acknowledge character length and current input character length and, using the result that calculates as current limited length fiducial value;
Such as, when the character string confirming input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, it is 0 that input control obtains current markers character length according to the length attribute of tab character, obtain in preliminary election input control interface and confirm that the character string total length in input control interface is 2, namely current character total length is 2, the length obtaining the character of current input according to the first parameter length attribute is 1, namely current input character length is 1, obtaining current acknowledge character length according to current character total length and current markers character length is 2, obtaining current limited length fiducial value according to current acknowledge character length and current input character length computation is 3.
Such as, when the character string confirming input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein " ni hao " is labeled, when input control get character keys type information as English character " n " perform to this step time, it is 6 that input control obtains current markers character length according to the length attribute of tab character, obtain in preliminary election input control interface and confirm that the character string total length in input control interface is 8, namely current character total length is 8, the length obtaining the character of current input according to the first parameter length attribute is 1, namely current input character length is 1, obtaining current acknowledge character length according to current character total length and current markers character length is 2, obtaining current limited length fiducial value according to current acknowledge character length and current input character length is 3.
When confirming that the character string at input control interface be " hello for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, it is 0 that input control obtains current markers character length according to the length attribute of tab character, obtain in preliminary election input control interface and confirm that the character string total length in input control interface is 30, namely current character total length is 30, the length 1 of the character of current input is obtained according to the first parameter length attribute, namely current input character length is 1, obtaining current acknowledge character length according to current character total length and current markers character length is 30, obtaining current limited length fiducial value according to current acknowledge character length and current input character length is 31.
Step 405: input control judges whether current limited length fiducial value is greater than default limited length value, is return step 402, otherwise perform step 406;
In the present embodiment, preferably, presetting limited length value is 30, represents that input control allows the maximum length being presented at the character string confirmed in input control interface to be 30.
Such as, when the character string confirming input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, current limited length fiducial value is 3, input control judges that 3 are less than 30, and input control performs step 406.
When the character string confirming input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein " ni hao " is labeled, when input control get character keys type information as English character " n " perform to this step time, current limited length fiducial value is 3, input control judges that 3 are less than 30, and input control performs step 406.
When confirming that the character string at input control interface be " hello for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, current limited length fiducial value is 31, input control judges that 31 are greater than 30, and input control returns step 402;
When confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, current limited length fiducial value is 34, and input control returns step 402.
In this step 405, input control before returning step 402, can also perform step f1 after judging that current limited length fiducial value is greater than default limited length value,
F1: input control is from the text reference position confirmed in input control interface, and intercepted length is the character string of restriction length value, is confirming the character string showing intercepting in input control interface;
Such as: when confirming that the character string at input control interface be " hello for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, current limited length fiducial value is 31, input control judges that 31 are greater than 30, input control intercepts from the text reference position in input control interface, intercepted length is the character string of 30, namely intercept " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ", confirming the character string showing intercepting in input control interface, namely show " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ",
When confirming that the character string in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, input control intercepts from the text reference position in input control interface, intercepted length is the character string of 30, namely intercept " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ", confirming the character string showing intercepting in input control interface, namely show " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ".
Step 406: input control shows the character of input in preliminary election input control interface, returns step 402;
Such as, when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, when input control get character keys type information as English character " n " perform to this step time, now, input control shows " n " in preliminary election input control interface, now, confirm that the character string in input control interface is " Zhang San ", the character string in preliminary election input control interface is " n ".
When confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein " ni hao " is labeled, when input control get character keys type information as English character " n " perform to this step time, input control shows " n " in preliminary election input control interface, now, confirm that the character string in input control interface is " Zhang San ", character string in preliminary election input control interface is " ni hao n ", and wherein " ni hao n " is labeled.
In the present embodiment, when input control gets input information by principal method, according to the method described in step 402, corresponding operating will be performed.
It should be noted that, based on the characteristic of IOS system, under the spelling input method that IOS system carries, candidate characters cannot be chosen to be the message of the character confirming input by input control by the first parameter acquiring user.When system get when user selects candidate characters to replace the message of character of wait acknowledge input or the message of input association character time or get user by pasting boards input character message when system time, system is directly confirming to show in input control interface candidate characters that user selects to input or is associating character or derive from the character of pasting boards input, in this case, input control cannot according to the first parameter acquiring to these information.
Such as: when confirming that the character string in input control interface be " Zhang San you good hello your good hello your good hello your good hello your good hello your good hello happiness ", when character string in preliminary election input control interface is " ni ha ", wherein, " ni ha " is labeled, when input control get character keys type information as English character " o " perform to this step time, input control shows " o " in preliminary election input control interface, now, the character string confirming in input control interface be " Zhang San you good hello your good hello your good hello your good hello your good hello your good happiness ", character string in preliminary election input control interface is " ni hao ", wherein " ni hao " is labeled.Now, if system get you in user's selection candidate characters replace wait acknowledge to input well character " ni hao ", system is in confirmation input control interface display " hello ", now, the character string confirming in input control interface be " hello for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", character string in preliminary election input control interface is empty, the message that input control cannot be replaced by candidate characters " hello " to the tab character " ni hao " in preliminary election input control interface by the first parameter acquiring, now, if system gets the message that user continues to select input association's character " ", system is in confirmation input control interface display " ", now, the character string confirming in input control interface be " how do you do for your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San ", input control cannot by the input message of the first parameter acquiring to association's character " ".
When confirming that the character string in input control interface be " Zhang San you good hello your good hello your good hello your good hello your good hello your good hello happiness ", character string in preliminary election input control interface is empty, now, if system gets the message of user by pasting boards input " you good happy m ", system is at confirmation input control interface display " you good happy m ", now, the character string confirming in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", character string in preliminary election input control interface is empty, input control cannot by the input message of the first parameter acquiring to association's character " ".
Step 407: input control packs up soft keyboard, is presented at the current string in preliminary election input control interface and confirms in input control interface;
Particularly, input control packs up soft keyboard, by the Charactes Display of the wait acknowledge input in preliminary election input control interface in confirmation input control interface.
Such as: when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein, " ni hao " is labeled, when input control gets enter key type, input control packs up soft keyboard, " ni hao " is shown to and confirms in input control interface, now confirm that the character string in input control interface is " Zhang San ni hao ", the character string in preliminary election input control interface is empty.
Step 408: input control obtains the current character total length confirmed in input control interface, judge whether current character total length is greater than default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, show in confirmation input control interface and intercept character string, terminate; Otherwise, terminate.
Particularly, input control obtains the current character total length being presented at and confirming in input control interface according to the text size attribute of the current string confirmed in input control interface, judge to be presented at and confirm whether the current character total length in input control interface is greater than default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, shows and intercepts character string, terminate in confirmation input control interface; Otherwise, terminate.
Such as: when confirming that the character string in input control interface is " Zhang San ni hao ", character string in preliminary election input control interface is empty, input control obtains according to the text size attribute of the current string confirmed in input control interface and confirms that the current character total length in input control interface is 8, judge that 8 are less than default limited length fiducial value, terminate.
When confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", character string in preliminary election input control interface is empty, input control obtains according to the text size attribute of the current string confirmed in input control interface and confirms that the current character total length in input control interface is 33, judge that 33 are greater than default limited length fiducial value, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, character string is intercepted in confirmation input control interface display, namely confirmation input control interface display " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ", terminate.
In the present embodiment, input control calls principal method and obtains input information, when passing through the first parameter acquiring to current input information, judge current input information type, if character keys type, input control then obtains current acknowledge character length and current input character length, input control obtains current limited length fiducial value according to current acknowledge character length and current input character length, input control judges whether current limited length fiducial value is greater than default limited length value, if, intercept from the text reference position confirmed in input control interface, intercepted length is the character string of default limited length value, confirming the character string showing intercepting in input control interface, return and obtain input information Step, otherwise at the current input information that preliminary election input control interface display obtains, return and obtain input information Step, if other function key types, then perform corresponding operating, return and obtain input information Step, when other function key types are delete key types, input control is according to the current significant character length of the second parameter acquiring, current limited length fiducial value is obtained according to current significant character length, input control judges whether current limited length fiducial value is greater than default limited length value, if, then intercept and confirm that in input control interface, length is the character string of default limited length value, otherwise execution deletion action, returns and obtains input information Step, if enter key type, then the current string in preliminary election input control interface is presented at and confirms in input control interface by input control, obtain the current character total length being presented at and confirming in input control interface, judge to be presented at and confirm whether the current character total length in input control interface is greater than default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, show in confirmation input control interface and intercept character string, terminate, otherwise, terminate.The technical program accurately can not limit the technical matters of the string length in input control interface under overcoming IOS system, achieve the accurate restriction of the string length in input control interface, also improve the experience effect of user better.
Embodiment 5
The embodiment of the present invention 5 provides a kind of input media of restricted character string length, specifically as shown in Figure 3, comprising:
First acquisition module 501, obtaining current input information for calling principal method, triggering the first judge module 502;
First acquisition module 501, obtains current input information specifically for the first parameter (string) by principal method (shouldChangeCharactersInRange).
First judge module 502, for judging the type of current input information, when the type of current input information is character keys type, trigger the second acquisition module 503, when the type of current input information is enter key type, trigger the first display module 504, when the type of current input information is other function key types, trigger the first processing module 505;
First judge module 502, specifically for judging the type of current input information according to the information of the first parameter, if the information of the first parameter is character key information, then judges that the type of current input information is character keys type, triggers the second acquisition module 503; If the information of the first parameter is enter key information, then judge that the type of current input information is enter key type, trigger the first display module 504; If the first parameter is other function key information, then judges that the type of current input information is other function key types, trigger the first processing module 505.
Wherein, character key information can be numerical character key information, English character key information, space character key information, punctuation character key information, expression character key information.
Other function key information refer to the key information outside character key information in soft keyboard, enter key information, comprise delete key information, shift information etc.
First processing module 505, comprises the first delete cells.
In this enforcement, when the first judge module 502 judges that the type of current input information is delete key type, trigger the first delete cells;
First delete cells, for deleting preliminary election input control interface or confirming the first character before the input cursor position in input control interface, triggers the first acquisition module 501.
Such as: when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein, " ni hao " is labeled, input cursor is after " o ", first delete cells deletes the character " o " in preliminary election input control interface, and now confirm that the character string in input control interface is " Zhang San ", the character string in preliminary election input control interface is " ni ha ".
When confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, if input cursor is after " three ", before first " you ", first delete cells delete character " three ", now confirms that the character string in input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness you well happy m ".
Second acquisition module 503, for according to being obtained current markers character length by the character string of system marks in preliminary election input control interface, current character total length is obtained according to the character string be presented in preliminary election input control interface and the character string be presented in confirmation input control interface, current input character length is obtained according to current input information, obtain current limited length fiducial value according to current markers character length, current character total length, current input character length, trigger the second judge module 506;
Such as, when the character string confirming input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, when input media get character keys type information as English character " n " perform to this step time, second acquisition module 503 according in preliminary election input control interface to be obtained current markers character length by the character string of system marks be 0, obtaining current character total length according to the character string be presented in preliminary election input control interface and the character string be presented in confirmation input control interface is 2, the length obtaining the character of the current input of current input character length according to current input information is 1, namely current input character length is 1, according to current character total length, current markers character length, obtaining current limited length fiducial value according to current acknowledge character length is 3.
In the present embodiment, the second acquisition module 503 can comprise: the first acquiring unit, second acquisition unit, the 3rd acquiring unit;
First acquiring unit, the method (markedTextRange) for the character range of the mark wait acknowledge of calling system obtains by the scope of the character string of system marks, triggers second acquisition unit;
Such as, when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, first acquiring unit is according to the character obtaining the wait acknowledge input in preliminary election input control interface of the method for the character range of mark wait acknowledge for empty, and the tab character scope got is null value.
Second acquisition unit, for according to being obtained current by the character string of system marks by the scope of the character string of system marks, triggers the 3rd acquiring unit;
3rd acquiring unit, for current by the length of the character string of system marks according to what obtained in preliminary election input control interface by the length attribute of the character string of system marks, using in preliminary election input control interface by the length of the character string of system marks as current markers character length.
In the present embodiment, the second acquisition module 503 can comprise: the 4th acquiring unit;
4th acquiring unit, for obtaining the length of the character string be presented in preliminary election input control interface according to the text size attribute being presented at character string in preliminary election input control interface and being presented at the character string confirmed in input control interface and be presented at the length sum of the character string confirmed in input control interface, using the length of the character string be presented in preliminary election input control interface and be presented at the character string confirmed in input control interface length sum as current character total length.
In the present embodiment, the second acquisition module 503 can comprise: the 5th acquiring unit;
5th acquiring unit, obtains current input character length for the text size attribute according to current input information.
In the present embodiment, the second acquisition module 503 can comprise: the 6th acquiring unit, the 7th acquiring unit;
6th acquiring unit, for obtaining current acknowledge character length according to current markers character length and current character total length, triggers the 7th acquiring unit;
6th acquiring unit, specifically for obtaining the absolute value of the difference of current character total length and current markers character length, using the absolute difference of current character total length and current markers character length as current acknowledge character length, triggers the 7th acquiring unit;
7th acquiring unit, for obtaining current limited length fiducial value according to current acknowledge character length and current input character length.
7th acquiring unit, specifically for obtain current acknowledge character length and current input character length and, using current acknowledge character length and current confirmation input character length and as current limited length fiducial value.
It should be noted that, in the present embodiment, the second acquisition module 503 can also comprise: the first acquiring unit, second acquisition unit, the 3rd acquiring unit, the 4th acquiring unit, the 5th acquiring unit, the 6th acquiring unit, the 7th acquiring unit;
Also it should be noted that; in the present embodiment; the various combined methods of the first acquiring unit in the second acquisition module 503, second acquisition unit, the 3rd acquiring unit, the 4th acquiring unit, the 5th acquiring unit, the 6th acquiring unit, the 7th acquiring unit, all belong to the protection domain of the embodiment of the present invention.
Second judge module 506, for judging whether the second display module can show current input information according to current limited length fiducial value, if so, then triggers the second display module 507; Otherwise, trigger the first acquisition module 501;
Second judge module 506, specifically for judging whether current limited length fiducial value is not more than default limited length value, if so, then judges to show current input information, triggers the second display module 507; If current limited length fiducial value is greater than default limited length value, then judges to show current input information, trigger the first acquisition module 501.
In the present embodiment, preferably, presetting limited length value is 30, represents that input control allows the maximum length being presented at the character string confirmed in input control interface to be 30.
Such as, when the character string confirming input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, when input media get character keys type information as English character " n " perform to this step time, current limited length fiducial value is 3, second judge module 506 judges that 3 are less than 30, triggers the second display module 507.
Second display module 507, for showing current input information in preliminary election input control interface, triggers the first acquisition module 501;
Such as, when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is empty, when input media get character keys type information as English character " n " perform to this step time, now, the second display module 507 shows " n " in preliminary election input control interface, now, confirm that the character string in input control interface is " Zhang San ", the character string in preliminary election input control interface is " n ".
First display module 504, is confirming, in input control interface, to trigger the 3rd acquisition module 508 for the character string display that will be presented in preliminary election input control interface;
Such as: when confirming that the character string in input control interface is " Zhang San ", when character string in preliminary election input control interface is " ni hao ", wherein, " ni hao " is labeled, when input media gets enter key type, " ni hao " is shown to and confirms in input control interface by the first display module 504, now confirms that the character string in input control interface is " Zhang San ni hao ", and the character string in preliminary election input control interface is empty.
3rd acquisition module 508, for obtaining the current character total length being presented at and confirming in input control interface, triggers the 3rd judge module 509;
3rd acquisition module 508, specifically for obtaining according to the text size attribute being presented at the character string confirmed in input control interface the current character total length being presented at and confirming in input control interface, triggers the 3rd judge module 509.
Such as: when confirming that the character string in input control interface is " Zhang San ni hao ", character string in preliminary election input control interface is empty, 3rd acquisition module 508 obtains to be presented at according to the text size attribute being presented at the current string confirmed in input control interface and confirms that the current character total length in input control interface is 8, triggers the 3rd judge module 509.
When confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", character string in preliminary election input control interface is empty, 3rd acquisition module 508 obtains according to the text size attribute being presented at the current string confirmed in input control interface and confirms that the current character total length in input control interface is 33, triggers the 3rd judge module 509.
For judging to be presented at, 3rd judge module 509, confirms whether the current character total length in input control interface is greater than default limited length value, if so, then triggers the first interception module 510; Otherwise, terminate.
Such as: when being presented at the current character total length confirmed in input control interface and being 8, the 3rd judge module 509 judges that the current character total length be presented in confirmation input control interface is less than default limited length value, terminates.
When being presented at the current character total length confirmed in input control interface and being 33, the 3rd judge module 509 judges that 33 are greater than default limited length fiducial value, triggers the first interception module 510;
First interception module 510, for from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, triggers the 3rd display module 511;
Such as: when confirming that the character string at input control interface be " your good hello your good hello your good hello your good hello your good hello your good hello happiness of Zhang San you well happy m ", when character string in preliminary election input control interface is empty, first interception module 510 is from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, triggers the 3rd display module 511.
In the present embodiment, confirm that the text reference position in input control interface is 0.
3rd display module 511, for showing the character string be truncated in confirmation input control interface.
Such as: when the character string be truncated to for " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello " time, 3rd display module 511 is confirming the character string that input control interface display is truncated to, namely confirmation input control interface display " Zhang San you good hello you good hello you good hello you good hello you good hello you good hello that glad hello ".
In the present embodiment, input media can also comprise the second interception module, the 4th display module;
After the second judge module 506 judges to show current input information according to current limited length fiducial value, second interception module, be the character string of default limited length value for intercepted length from confirming the text reference position at input control interface, trigger the 4th display module;
4th display module, for showing the character string be truncated in confirmation input control interface, triggers the first acquisition module 501.
In the present embodiment, input media can also comprise: the 4th acquisition module, the 4th judge module, the 3rd interception module, the 4th display module;
When the first judge module 502 judges that the type of current input information is delete key type,
4th acquisition module, current index-location values is obtained for the second parameter (range) according to principal method, obtain current significant character length according to current index-location values, using current significant character length as current limited length fiducial value, trigger the 4th judge module;
4th acquisition module, specifically for according to the current index-location values of the second parameter acquiring, the character string that intercepted length is identical with current index-location values from confirming the text reference position at input control interface, obtain the length of character string be truncated to, using the length of character string that is truncated to as current significant character length.
4th acquisition module, can also specifically for according to the current index-location values of the second parameter acquiring, using current index-location values as current significant character length.
4th judge module, for judging whether energy delete character according to current limited length fiducial value, if so, then triggers the first delete cells, otherwise, trigger the 3rd interception module;
3rd interception module, is the character string of default limited length value for intercepted length from confirming the text reference position at input control interface, triggers the 4th display module;
4th display module, for showing the character string be truncated in confirmation input control interface, triggers the first acquisition module 501.
Above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.

Claims (28)

1. a method for restricted character string length, is characterized in that, comprising:
Step s1: input control calls principal method and obtains current input information, when getting described current input information, judge the type of described current input information, if the type of described current input information is character keys type, then perform step s2, if the type of described current input information is enter key type, then perform step s5, if the type of described current input information is other function key types, then return step s1 after performing corresponding operating;
Step s2: described input control is according to being obtained current markers character length by the character string of system marks in preliminary election input control interface, current character total length is obtained according to the character string be presented in preliminary election input control interface and the character string be presented in confirmation input control interface, current input character length is obtained according to described current input information, according to described current markers character length, described current character total length and described current input character length, obtain current limited length fiducial value;
Step s3: described input control, according to described current limited length fiducial value, judges whether to show described current input information, if so, then performs step s4, otherwise, return step s1;
Step s4: described input control shows described current input information in preliminary election input control interface, returns step s1;
Step s5: the character string display be presented in preliminary election input control interface is confirming in input control interface by described input control, obtain the current character total length being presented at and confirming in input control interface, be presented at described in judgement and confirm whether the current character total length in input control interface is greater than default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of described default limited length value, in confirmation input control interface, show the character string be truncated to, terminate; Otherwise, terminate.
2. method according to claim 1, is characterized in that, input control described in described step s1 calls principal method and obtains current input information, when getting described current input information, judging the type of described current input information, specifically comprising:
Described input control calls principal method and obtains current input information, when passing through the first parameter acquiring to described current input information, described input control judges the type of described current input information according to the information of described first parameter, if the information of described first parameter is character key information, then judge that the type of described current input information is character keys type, if the information of described first parameter is enter key information, then judge that the type of described current input information is enter key type, if described first parameter is other function key information, then judge that the type of described current input information is other function key types.
3. method according to claim 1, is characterized in that, in described step s2, described input control, according to being obtained current markers character length by the character string of system marks in preliminary election input control interface, specifically comprises:
Step a1: the method for the character range of the mark wait acknowledge of described input control calling system obtains by the scope of the character string of system marks;
Step a2: described input control is obtained current by the character string of system marks according to described by the scope of the character string of system marks;
Step a3: to be obtained in preliminary election input control interface by the text size attribute of the character string of system marks current by the length of the character string of system marks according to described for described input control, using in preliminary election input control interface by the length of the character string of system marks as described current markers character length.
4. method according to claim 1, it is characterized in that, input control described in described step s2 is according to the character string be presented in preliminary election input control interface and be presented at the character string acquisition current character total length confirmed in input control interface, specifically comprises:
Described input control obtains the length of the character string be presented in preliminary election input control interface according to self text size attribute and is presented at the length sum of the character string confirmed in input control interface, using the length of the character string be presented in preliminary election input control interface and be presented at the character string confirmed in input control interface length sum as described current character total length.
5. method according to claim 1, is characterized in that, in described step s2, described input control obtains current input character length according to described current input information, specifically comprises:
Described input control obtains described current input character length according to the text size attribute of described current input information.
6. method according to claim 1, it is characterized in that, in described step s2, described input control is according to described current markers character length, described current character total length and described current input character length, obtain current limited length fiducial value, specifically comprise:
Step b1: described input control obtains current acknowledge character length according to described current markers character length and described current character total length;
Step b2: described input control obtains described current limited length fiducial value according to described current acknowledge character length and described current input character length.
7. method according to claim 6, it is characterized in that, described step b1 specifically comprises: described input control obtains the absolute value of the difference of described current character total length and described current markers character length, using the absolute difference of described current character total length and described current markers character length as described current acknowledge character length;
Described step b2 specifically comprises: described input control obtain described current acknowledge character length and described current input character length with, using described current acknowledge character length and described current confirmation input character length and as described current limited length fiducial value.
8. method according to claim 1, is characterized in that, described step s3 specifically comprises:
Described input control judges whether described current limited length fiducial value is not more than described default limited length value, if, then judge to show described current input information, perform step s4, if described current limited length fiducial value is greater than described default limited length value, then judge to show described current input information, return step s1.
9. method according to claim 1, is characterized in that, input control described in described step s3 also comprises after judging to show described current input information according to described current limited length fiducial value:
Described input control intercepted length from confirming the text reference position at input control interface is the character string of described default limited length value, shows the character string be truncated to, return step s1 in confirmation input control interface.
10. method according to claim 1, is characterized in that, described step s5 specifically comprises:
The character string display be presented in preliminary election input control interface is confirming in input control interface by described input control, text size attribute according to being presented at the character string confirmed in input control interface obtains the current character total length being presented at and confirming in input control interface, be presented at described in judgement and confirm whether the current character total length in input control interface is greater than described default limited length value, if, then from confirming the text reference position at input control interface, intercepted length is the character string of described default limited length value, the character string be truncated to is shown in confirmation input control interface, terminate, otherwise, terminate.
11. methods according to claim 1, it is characterized in that, described input control calls principal method and obtains current input information, when getting described current input information, judge the type of described current input information, if the type of described current input information is other function key types, after performing corresponding operating, returns step s1, specifically comprise:
Described input control calls principal method and obtains current input information, when getting described current input information, judge the type of described current input information, if the type of described current input information is delete key type, first character before then deleting preliminary election input control interface or confirming the input cursor position in input control interface, returns step s1.
12. methods according to claim 11, it is characterized in that, after described input control judges that described current input information type is delete key type, before the first character before deleting preliminary election input control interface or confirming the input cursor position in input control interface, also comprise:
Step c1: described input control, according to the current index-location values of the second parameter acquiring, obtains current significant character length according to described current index-location values, using described current significant character length as current limited length fiducial value;
Step c2: described input control judges whether energy delete character according to described current limited length fiducial value, if so, then the first character before deleting preliminary election input control interface or confirming the input cursor position in input control interface, returns step s1; Otherwise from confirming the text reference position at input control interface, intercepted length is the character string of default limited length value, shows the character string be truncated to, return step s1 in confirmation input control interface.
13. methods according to claim 12, it is characterized in that, input control described in described step c1 obtains current significant character length according to described current index-location values and specifically comprises: the described input control character string that intercepted length is identical with described current index-location values from confirming the text reference position at input control interface, obtain the length of the character string be truncated to, using the length of the described character string be truncated to as described current significant character length.
14. methods according to claim 12, it is characterized in that, describedly obtain current significant character length according to input control described in described step c1 according to described current index-location values and specifically comprise: using described current index-location values as described current significant character length.
The input media of 15. 1 kinds of restricted character string length, is characterized in that, comprising:
First acquisition module, obtaining current input information for calling principal method, triggering the first judge module;
First judge module, for judging the type of described current input information, when the type of described current input information is character keys type, trigger the second acquisition module, when the type of described current input information is enter key type, trigger the first display module, when the type of described current input information is other function key types, trigger the first processing module;
First processing module, for when described first judge module judges that the type of described current input information is other function key types, performs corresponding operating, triggers the first acquisition module;
Second acquisition module, for according to being obtained current markers character length by the character string of system marks in preliminary election input control interface, current character total length is obtained according to the character string be presented in preliminary election input control interface and the character string be presented in confirmation input control interface, current input character length is obtained according to described current input information, according to described current markers character length, described current character total length and described current input character length, obtain current limited length fiducial value, trigger the second judge module;
Second judge module, for judging whether the second display module can show described current input information according to described current limited length fiducial value, if so, then triggers the second display module; Otherwise, trigger the first acquisition module;
Second display module, for showing described current input information in preliminary election input control interface, triggers the first acquisition module;
First display module, is confirming, in input control interface, to trigger the 3rd acquisition module for the character string display that will be presented in preliminary election input control interface;
3rd acquisition module, for obtaining the current character total length being presented at and confirming in input control interface, triggers the 3rd judge module;
For being presented at described in judging, 3rd judge module, confirms whether the current character total length in input control interface is greater than default limited length value, if so, then triggers the first interception module; Otherwise, terminate;
First interception module, for from confirming the text reference position at input control interface, intercepted length is the character string of described default limited length value, triggers the 3rd display module;
3rd display module, for showing the character string be truncated in confirmation input control interface.
16. input medias according to claim 15, is characterized in that,
Described first acquisition module, specifically for current input information according to the first parameter acquiring of described principal method;
Described first judge module, specifically for judging the type of described current input information according to the information of described first parameter, if the information of described first parameter is character key information, then judge that the type of described current input information is character keys type, trigger described second acquisition module; If the information of described first parameter is enter key information, then judge that the type of described current input information is enter key type, trigger described first display module; If described first parameter is other function key information, then judges that the type of described current input information is other function key types, trigger described first processing module.
17. input medias according to claim 15, is characterized in that, described second obtains mould module, specifically comprises: the first acquiring unit, second acquisition unit, the 3rd acquiring unit;
Described first acquiring unit, the method for the character range of the mark wait acknowledge of calling system obtains by the scope of the character string of system marks, triggers second acquisition unit;
Described second acquisition unit, for being obtained current by the character string of system marks according to described by the scope of the character string of system marks, triggers the 3rd acquiring unit;
3rd acquiring unit, for to be obtained in preliminary election input control interface by the text size attribute of the character string of system marks current by the length of the character string of system marks according to described, using in preliminary election input control interface by the length of the character string of system marks as described current markers character length.
18. input medias according to claim 15, is characterized in that, described second acquisition module, specifically comprises: the 4th acquiring unit;
Described 4th acquiring unit, for obtaining the length of the character string be presented in preliminary election input control interface according to the text size attribute of described input media and being presented at the length sum of the character string confirmed in input control interface, using the length of the character string be presented in preliminary election input control interface and be presented at the character string confirmed in input control interface length sum as described current character total length.
19. input medias according to claim 15, is characterized in that, described second obtains mould module, specifically comprises: the 5th acquiring unit;
Described 5th acquiring unit, for obtaining described current input character length according to the text size attribute of described current input information.
20. input medias according to claim 15, is characterized in that, described second acquisition module, specifically comprises: the 6th acquiring unit, the 7th acquiring unit;
Described 6th acquiring unit, for obtaining current acknowledge character length according to described current markers character length and described current character total length, triggers the 7th acquiring unit;
Described 7th acquiring unit, for obtaining described current limited length fiducial value according to described current acknowledge character length and described current input character length.
21. input medias according to claim 20, is characterized in that,
Described 6th acquiring unit, specifically for obtaining the absolute value of the difference of described current character total length and described current markers character length, using the absolute difference of described current character total length and described current markers character length as described current acknowledge character length, trigger described 7th acquiring unit;
Described 7th acquiring unit, specifically for obtain described current acknowledge character length and described current input character length and, using described current acknowledge character length and described current confirmation input character length and as described current limited length fiducial value.
22. input medias according to claim 15, is characterized in that,
Described second judge module, specifically for judging whether described current limited length fiducial value is not more than described default limited length value, if so, then judges to show described current input information, triggers described second display module; If described current limited length fiducial value is greater than default limited length value, then judges to show described current input information, trigger described first acquisition module.
23. input medias according to claim 15, is characterized in that, described input media also comprises the second interception module, the 4th display module;
After described second judge module judges to show described current input information according to described current limited length fiducial value, described second interception module, be the character string of described default limited length value for intercepted length from confirming the text reference position at input control interface, trigger described 4th display module;
Described 4th display module, for showing the character string be truncated in confirmation input control interface, triggers described first acquisition module.
24. input medias according to claim 15, is characterized in that,
3rd acquisition module, specifically for obtaining according to the text size attribute being presented at the character string confirmed in input control interface the current character total length being presented at and confirming in input control interface, triggers described 3rd judge module.
25. input medias according to claim 15, is characterized in that, described first processing module, comprising: the first delete cells;
Described first processing module, specifically for when described first judge module judges that the type of described current input information is delete key type, triggers the first delete cells;
Described first delete cells, for deleting preliminary election input control interface or confirming the first character before the input cursor position in input control interface, triggers the first acquisition module.
26. input medias according to claim 25, is characterized in that, described input media, also comprises: the 4th acquisition module, the 4th judge module, the 3rd interception module, the 4th display module;
After described first judge module judges that the type of described current input information is delete key type, described 4th acquisition module is according to the current index-location values of the second parameter acquiring of principal method, current significant character length is obtained according to described current index-location values, using described current significant character length as current limited length fiducial value, trigger described 4th judge module;
Described 4th judge module, for judging whether energy delete character according to described current limited length fiducial value, if so, then triggers described first delete cells, otherwise, trigger described 3rd interception module;
Described 3rd interception module, is the character string of default limited length value for intercepted length from confirming the text reference position at input control interface, triggers described 4th display module;
Described 4th display module, for showing the character string be truncated in confirmation input control interface, triggers described first acquisition module.
27. input medias according to claim 26, is characterized in that,
Described 4th acquisition module, specifically for according to the current index-location values of described second parameter acquiring, the character string that intercepted length is identical with described current index-location values from confirming the text reference position at input control interface, obtain the length of the character string be truncated to, using the length of the described character string be truncated to as described current significant character length.
28. input medias according to claim 27, is characterized in that, described 4th acquisition module, specifically for according to the current index-location values of described second parameter acquiring, using described current index-location values as described current significant character length.
CN201410779699.6A 2014-12-16 2014-12-16 A kind of input unit and method of restricted character string length Active CN104461054B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410779699.6A CN104461054B (en) 2014-12-16 2014-12-16 A kind of input unit and method of restricted character string length

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410779699.6A CN104461054B (en) 2014-12-16 2014-12-16 A kind of input unit and method of restricted character string length

Publications (2)

Publication Number Publication Date
CN104461054A true CN104461054A (en) 2015-03-25
CN104461054B CN104461054B (en) 2017-11-24

Family

ID=52907243

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410779699.6A Active CN104461054B (en) 2014-12-16 2014-12-16 A kind of input unit and method of restricted character string length

Country Status (1)

Country Link
CN (1) CN104461054B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110633437A (en) * 2018-05-31 2019-12-31 阿里巴巴集团控股有限公司 Method and device for omitting display of multiple lines
CN111339735A (en) * 2020-03-06 2020-06-26 广州华多网络科技有限公司 Character string length calculation method and device and computer storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101158940A (en) * 2007-11-21 2008-04-09 金蝶软件(中国)有限公司 Method and device for dwindling character stuffing in target region
CN102609108A (en) * 2012-02-15 2012-07-25 张群 Electronic equipment for inputting characters and method for inputting characters into electronic equipment
CN102750088A (en) * 2012-06-04 2012-10-24 华为终端有限公司 Method and electronic device for prompting character inputting
CN102831347A (en) * 2012-07-31 2012-12-19 飞天诚信科技股份有限公司 Data processing method and device
CN102902659A (en) * 2012-09-18 2013-01-30 珠海金山办公软件有限公司 Method and terminal for processing numeric character strings in electronic form
CN102929492A (en) * 2012-11-25 2013-02-13 上海量明科技发展有限公司 Method for adjusting candidate item sequence in input methods as well as client terminal and character library

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101158940A (en) * 2007-11-21 2008-04-09 金蝶软件(中国)有限公司 Method and device for dwindling character stuffing in target region
CN102609108A (en) * 2012-02-15 2012-07-25 张群 Electronic equipment for inputting characters and method for inputting characters into electronic equipment
CN102750088A (en) * 2012-06-04 2012-10-24 华为终端有限公司 Method and electronic device for prompting character inputting
CN102831347A (en) * 2012-07-31 2012-12-19 飞天诚信科技股份有限公司 Data processing method and device
CN102902659A (en) * 2012-09-18 2013-01-30 珠海金山办公软件有限公司 Method and terminal for processing numeric character strings in electronic form
CN102929492A (en) * 2012-11-25 2013-02-13 上海量明科技发展有限公司 Method for adjusting candidate item sequence in input methods as well as client terminal and character library

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
CLIN: "限制UITextField输入长度", 《网页在线公开:WWW.CNBLOGS.COM/CLIN/P/3413146.HTML》 *
CLWAHAHA: "UITextField对中英文混合输入的长度限制", 《网页在线公开:BLOG.CSDN.NET/CLWAHAHA/ARTICLE/DETAILS/24368627》 *
CPLASF_LIXJ: "UITextField和UITextView限制字符个数的方法", 《网页在线公开:BOLG.CSDN.NET/QIJIANLI/ARTICLE/DETAILS/8313181》 *
TANGAOWEN: "如何实现对输入框的文本内容进行限制的功能", 《网页在线公开:BLOG.CSDN.NET/TANGAOWEN/ARTICLE/DETAILS/6437566》 *
WONDERFFEE: "iOS6下UITextField退格变清空问题的解决方法", 《网页在线公开:HTTP://WWW.TUICOOL.COM/ARTICLES/YYQRNQ》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110633437A (en) * 2018-05-31 2019-12-31 阿里巴巴集团控股有限公司 Method and device for omitting display of multiple lines
CN111339735A (en) * 2020-03-06 2020-06-26 广州华多网络科技有限公司 Character string length calculation method and device and computer storage medium

Also Published As

Publication number Publication date
CN104461054B (en) 2017-11-24

Similar Documents

Publication Publication Date Title
US20180129897A1 (en) Handwriting-based predictive population of partial virtual keyboards
US20130007606A1 (en) Text deletion
JP6180888B2 (en) Electronic device, method and program
JP6427559B2 (en) Permanent synchronization system for handwriting input
WO2014147716A1 (en) Electronic device and handwritten document processing method
DE112012000403T5 (en) TOUCH SCREEN KEYBOARD WITH CORRECTION OF PREVIOUS TEXT
CN102937864A (en) Method and device for determining selected texts on touch terminals
KR20140039517A (en) Device and method implementing for particular function based on writing
CN113011168A (en) Filling-in-blank word filling system
CN101984389B (en) Method, device and terminal device for inputting Chinese characters
CN105739781A (en) Method and system for quickly and accurately positioning character cursor through pressure touch technology
CN102841752B (en) The characters input method of a kind of human-computer interaction device and device
CN104461054A (en) String length limited input device and string length limited input method
CN108737634B (en) Voice input method and device, computer device and computer readable storage medium
WO2014106911A1 (en) Information processing device and information updating program
CN104699409A (en) Information inputting method and information inputting system for mobile terminal of touch screen
CN106168880B (en) A kind of method and terminal of input control
CN104598045B (en) Five checker input method
CN106886297A (en) Input method optimization method, device and mobile terminal
CN102375655A (en) Alphabet input processing method and system
CN104991735A (en) Virtual keyboard input method and mobile terminal
CN104469013A (en) Mobile terminal and dial-up editing method thereof
CN106201004B (en) Virtual keyboard based on touch screen equipment and input method thereof
JP6202997B2 (en) Electronic device, method and program
KR101182670B1 (en) A process for inputting Korean alphabets on touch screen

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant