CN107861782A - Implementation method, device and the electronic equipment of input frame input control - Google Patents

Implementation method, device and the electronic equipment of input frame input control Download PDF

Info

Publication number
CN107861782A
CN107861782A CN201710973671.XA CN201710973671A CN107861782A CN 107861782 A CN107861782 A CN 107861782A CN 201710973671 A CN201710973671 A CN 201710973671A CN 107861782 A CN107861782 A CN 107861782A
Authority
CN
China
Prior art keywords
length
initial
input
control
interface
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.)
Withdrawn
Application number
CN201710973671.XA
Other languages
Chinese (zh)
Inventor
沈文策
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Cnfol Information Technology Co Ltd
Original Assignee
Fujian Cnfol Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Cnfol Information Technology Co Ltd filed Critical Fujian Cnfol Information Technology Co Ltd
Priority to CN201710973671.XA priority Critical patent/CN107861782A/en
Publication of CN107861782A publication Critical patent/CN107861782A/en
Withdrawn legal-status Critical Current

Links

Abstract

The invention provides implementation method, device and the electronic equipment of a kind of input frame input control, this method includes:Obtain the target widget pre-set;Target widget is added on interface by targeted manner, obtains the interface with target widget;The interface with target widget is rendered on screen, and loads other controls, obtains target interface.In the implementation method of the input frame input control of the present invention, directly the target widget being controlled with the input to input frame is added on interface by targeted manner, without being configured again to control, with regard to that can make the target widget in target interface that there is the function of input control, it is simple and convenient, code is succinct, separated simultaneously with the logic of other controls in target interface, improve the degree of coupling that interface redirects relevant treatment, in the implementation method for alleviating existing input frame input control, the cumbersome redundancy of code be present, the low technical problem of the relevant treatment degree of coupling that interface redirects.

Description

Implementation method, device and the electronic equipment of input frame input control
Technical field
The present invention relates to the technical field of application system, the implementation method controlled more particularly, to a kind of input of input frame, Device and electronic equipment.
Background technology
In the development process of Android, input frame is most common, and the input frame with input limitation and deletion action It is and very common.
It is this to be usually with input limitation and the implementation process of the input frame of deletion action:One is first added inside interface Individual EditText and Button (or ImageView), then, are obtained by the method for the FindViewByID in Activity Control, the logic of correlation is added, realize the function of input control.But if be related to multiple interfaces simultaneously, for example register boundary Face, login interface, Modify password interface etc., when being required for realizing the function of input control, if continuing to use above-mentioned single boundary Control is added on face, and the function of input control is implemented separately in each interface, then the cumbersome redundancy of code, boundary occurs The low situation of the relevant treatment degree of coupling that face redirects, it is complicated to use and change rather trouble.
To sum up, the implementation method of existing input frame input control will repeat above-mentioned single when realizing every time The process of input control is realized at interface, the cumbersome redundancy of code be present, the low technical problem of the relevant treatment degree of coupling that interface redirects.
The content of the invention
In view of this, the method, apparatus and electronic equipment controlled it is an object of the invention to provide a kind of input of input frame, To alleviate in the implementation method of existing input frame input control, the cumbersome redundancy of code, the relevant treatment coupling that interface redirects be present Right low technical problem.
In a first aspect, the embodiments of the invention provide a kind of implementation method of input frame input control, methods described includes:
The target widget pre-set is obtained, wherein, the input that the target widget is used for input frame is controlled, institute Stating target widget includes:Target EditText controls and target delete Button control;
The target widget is added on interface by targeted manner, obtains the interface with the target widget, its In, the targeted manner includes following any:AddView mode, quote the mode of xml topology files;
The interface with the target widget is rendered on screen, and loads other controls, obtains target interface.
With reference in a first aspect, the embodiments of the invention provide the possible embodiment of the first of first aspect, wherein, Before obtaining the target widget pre-set, methods described also includes:
Initial control is obtained, wherein, the initial control includes:Initial EditText controls and the initial Button that deletes are controlled Part;
The initial control is configured, obtains the target widget.
With reference in a first aspect, the embodiments of the invention provide the possible embodiment of second of first aspect, wherein, it is right The initial control is configured, and obtaining the target widget includes:
The label array object pre-set is obtained, wherein, comprising minimum character length in the label array object Information, the information of maximum character length, give tacit consent to the text information of display, it is described to delete pictorial information corresponding to Button control;
Instantiate the initial EditText controls and the initial deletion Button control;
The initial EditText controls and the initial attribute information for deleting Button control are configured, obtained Middle EditText controls and middle deletion Button control, wherein, the attribute information comprises at least:It is described initial The length of EditText controls, the width of the initial EditText controls, the initial length for deleting Button control are described initial Delete the width of Button control, initial EditText controls length ratio shared in interface, the initial deletion Button control length ratio shared in interface, the initial source for deleting picture corresponding to Button control;
Based on the label array object on the middle EditText controls and the middle deletion Button control OnTextChanged methods and afterTextChanged methods are loaded, obtains the target widget, with the length to inputting word Degree is controlled, wherein, the onTextChanged methods and the afterTextChanged methods are to input word The method that length is controlled.
With reference in a first aspect, the embodiments of the invention provide the possible embodiment of the third of first aspect, wherein, institute State onTextChanged methods to input word length be controlled including:
Judge the length of input word in input process;
If the length of the input word is less than the minimum character length or the length of the input word is more than The maximum character length, then the color for setting the input word is the first color, and sets the deletion Button control Corresponding picture is the first picture, wherein, first color is used to represent that the length of the input word is illegal, and described the Click event is loaded with one picture, for removing the input word;
If the length of the input word is more than the minimum character length and is less than the maximum character length, set The color for putting the input word is the second color, and it is second picture to set picture corresponding to the deletion Button control, Wherein, second color is used to represent that the length of the input word is legal.
With reference in a first aspect, the embodiments of the invention provide the possible embodiment of the 4th of first aspect kind, wherein, institute State afterTextChanged methods to input word length be controlled including:
When the length of the input word reaches the maximum character length during end of input, the interception maximum character length Input word is into the EditText controls corresponding to degree.
Second aspect, the embodiment of the present invention additionally provide a kind of realization device of input frame input control, described device bag Include:
First acquisition module, for obtaining the target widget pre-set, wherein, the target widget is used for input frame Input be controlled, the target widget includes:Target EditText controls and target delete Button control;
Add module, for the target widget to be added into interface by targeted manner, obtain carrying the target The interface of control, wherein, the targeted manner includes following any:AddView mode, quote the side of xml topology files Formula;
Load-on module is rendered, for rendering the interface with the target widget on screen, and other controls is loaded, obtains To target interface.
With reference to second aspect, the embodiments of the invention provide the possible embodiment of the first of second aspect, wherein, institute Stating device also includes:
Second acquisition module, for obtaining initial control, wherein, the initial control includes:Initial EditText controls Button control is deleted with initial;
Setup module, for being configured to the initial control, obtain the target widget.
With reference to second aspect, the embodiments of the invention provide the possible embodiment of second of second aspect, wherein, institute Stating setup module includes:
Acquiring unit, for obtaining the label array object pre-set, wherein, comprising most in the label array object The information of small characters length, the information of maximum character length, give tacit consent to the text information of display, the deletion Button control is correspondingly Pictorial information;
Instantiating unit, for instantiating the initial EditText controls and the initial deletion Button control;
Setting unit, for the initial EditText controls and the initial attribute information for deleting Button control It is configured, obtains middle EditText controls and middle deletion Button control, wherein, the attribute information comprises at least: The length of the initial EditText controls, the width of the initial EditText controls, the initial length for deleting Button control, The initial width for deleting Button control, initial EditText controls length ratio shared in interface are described first Begin to delete Button control length ratio shared in interface, picture comes corresponding to the initial deletion Button control Source;
Loading unit, for being deleted based on the label array object in the middle EditText controls and the centre OnTextChanged methods and afterTextChanged methods are loaded on Button control, the target widget is obtained, with right The length of input word is controlled, wherein, the onTextChanged methods and the afterTextChanged methods are The method being controlled to the length for inputting word.
With reference to second aspect, the embodiments of the invention provide the possible embodiment of the third of second aspect, wherein, institute Loading unit is stated to be additionally operable to:
Judge the length of input word in input process;
If the length of the input word is less than the minimum character length or the length of the input word is more than The maximum character length, then the color for setting the input word is the first color, and sets the deletion Button control Corresponding picture is the first picture, wherein, first color is used to represent that the length of the input word is illegal, and described the Click event is loaded with one picture, for removing the input word;
If the length of the input word is more than the minimum character length and is less than the maximum character length, set The color for putting the input word is the second color, and it is second picture to set picture corresponding to the deletion Button control, Wherein, second color is used to represent that the length of the input word is legal.
The third aspect, the embodiment of the present invention additionally provide a kind of electronic equipment, including memory, processor, the storage The computer program that can be run on the processor is stored with device, is realized described in the computing device during computer program The step of method described in above-mentioned first aspect.
The embodiment of the present invention brings following beneficial effect:The embodiments of the invention provide a kind of input control of input frame Implementation method, device and electronic equipment, this method include:The target widget that pre-sets is obtained, wherein, target widget is used for pair The input of input frame is controlled, and target widget includes:Target EditText controls and target delete Button control;Pass through mesh Target widget is added on interface by mark mode, obtains the interface with target widget, wherein, targeted manner includes following any Kind:AddView mode, quote the mode of xml topology files;The interface with target widget is rendered on screen, and is loaded Other controls, obtain target interface.
In the implementation method of existing input frame input control, it is required for adding control when using every time, meanwhile, add phase The logic of pass, to realize the function of inputting control.Compared with the implementation method of existing input frame input control, of the invention is defeated In the implementation method for entering frame input control, the target widget pre-set is directly obtained, the target widget is already had to defeated Enter the function that the input of frame is controlled, without adding the logic of correlation again, then, added target widget by targeted manner It is added on interface, obtains the interface with target widget, finally, the interface with target widget is rendered on screen, and load Other controls, obtain target interface., directly will tool by targeted manner in the implementation method of the input frame input control of the present invention The target widget for having the input to input frame to be controlled is added on interface, without being configured again to control, with regard to that can make mesh The target widget demarcated in face has the function of input control, and simple and convenient, code is succinct, at the same with it is other in target interface The logic of control is separated, and improves the degree of coupling that interface redirects relevant treatment, alleviates existing input frame input control Implementation method in, the cumbersome redundancy of code be present, the low technical problem of the relevant treatment degree of coupling that interface redirects.
Other features and advantages of the present invention will illustrate in the following description, also, partly become from specification Obtain it is clear that or being understood by implementing the present invention.The purpose of the present invention and other advantages are in specification, claims And specifically noted structure is realized and obtained in accompanying drawing.
To enable the above objects, features and advantages of the present invention to become apparent, preferred embodiment cited below particularly, and coordinate Appended accompanying drawing, is described in detail below.
Brief description of the drawings
, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical scheme of the prior art The required accompanying drawing used is briefly described in embodiment or description of the prior art, it should be apparent that, in describing below Accompanying drawing is some embodiments of the present invention, for those of ordinary skill in the art, before creative work is not paid Put, other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is a kind of flow chart of the implementation method of input frame input control provided in an embodiment of the present invention;
Fig. 2 is configured to be provided in an embodiment of the present invention to initial control, obtains the method flow diagram of target widget;
Fig. 3 is the side that onTextChanged methods provided in an embodiment of the present invention are controlled to the length for inputting word Method flow chart;
Fig. 4 is a kind of structured flowchart of the realization device of input frame input control provided in an embodiment of the present invention;
Fig. 5 is the schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with accompanying drawing to the present invention Technical scheme be clearly and completely described, it is clear that described embodiment is part of the embodiment of the present invention, rather than Whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creative work premise Lower obtained every other embodiment, belongs to the scope of protection of the invention.
For ease of understanding the present embodiment, control is inputted to a kind of input frame disclosed in the embodiment of the present invention first Implementation method describe in detail.
Embodiment one:
A kind of implementation method of input frame input control, with reference to figure 1, this method includes:
The target widget that S102, acquisition are pre-set, wherein, the input that target widget is used for input frame is controlled, Target widget includes:Target EditText controls and target delete Button control;
In embodiments of the present invention, the control that control function is inputted with input frame is configured in advance, had Input frame inputs the target widget of control function, so, can directly be added when being used, convenient and swift.
Specifically, target widget includes target EditText controls and target deletes Button control, the two controls exist Directly added as a View when using.
S104, by targeted manner target widget is added on interface, obtains the interface with target widget, wherein, Targeted manner includes following any:AddView mode, quote the mode of xml topology files;
After target widget is obtained, target widget is added on interface by targeted manner.Specifically, targeted manner bag Include following any:AddView mode, quote the mode of xml topology files
S106, the interface with target widget is rendered on screen, and load other controls, obtain target interface.
After the interface with target widget is obtained, this is rendered on screen and carries the interface of target widget, and is loaded Other controls, obtain target interface.So, the input control to input frame is can be realized as in target interface.
In the implementation method of existing input frame input control, it is required for adding control when using every time, meanwhile, add phase The logic of pass, to realize the function of inputting control.Compared with the implementation method of existing input frame input control, of the invention is defeated In the implementation method for entering frame input control, the target widget pre-set is directly obtained, the target widget is already had to defeated Enter the function that the input of frame is controlled, without adding the logic of correlation again, then, added target widget by targeted manner It is added on interface, obtains the interface with target widget, finally, the interface with target widget is rendered on screen, and load Other controls, obtain target interface., directly will tool by targeted manner in the implementation method of the input frame input control of the present invention The target widget for having the input to input frame to be controlled is added on interface, without being configured again to control, with regard to that can make mesh The target widget demarcated in face has the function of input control, and simple and convenient, code is succinct, at the same with it is other in target interface The logic of control is separated, and improves the degree of coupling that interface redirects relevant treatment, alleviates existing input frame input control Implementation method in, the cumbersome redundancy of code be present, the low technical problem of the relevant treatment degree of coupling that interface redirects.
How the above is only to by the target widget that control function is inputted with input frame to be added to process on interface Simple introduction has been carried out, the process pre-set has been described in detail below.
Alternatively, before the target widget pre-set is obtained, this method also includes:
Initial control is obtained, wherein, initial control includes:Initial EditText controls and initial deletion Button control;
Initial control is configured, obtains target widget.
Specifically, before the target widget pre-set is obtained, initial EditText controls and initial deletion are first obtained Button control, then, initial control is configured, obtains target widget.
Initial control is configured, obtain the method for target widget have it is a variety of, in one alternatively embodiment, ginseng Fig. 2 is examined, initial control is configured, obtaining target widget includes:
The label array object that S201, acquisition are pre-set, wherein, comprising minimum character length in label array object Information, the information of maximum character length, give tacit consent to the text information of display, delete pictorial information corresponding to Button control;
Specifically, first to obtain the label array object pre-set, minimum character length is included in label array object The information of degree, the information of maximum character length, give tacit consent to the text information of display, delete pictorial information corresponding to Button control, These information are all pre-set.
S202, instantiate initial EditText controls and initially delete Button control;
After the label array object pre-set, initial EditText controls and initial deletion Button are instantiated Control, it is, really obtaining an initial EditText control and an initial deletion Button control.
S203, initial EditText controls and the initial attribute information for deleting Button control are configured, in obtaining Between EditText controls and it is middle delete Button control, wherein, attribute information comprises at least:Initial EditText controls It is long, the width of initial EditText controls, the initial length for deleting Button control, the initial width for deleting Button control, initially EditText controls length ratio shared in interface, it is initial to delete Button control length ratio shared in interface, The initial source for deleting picture corresponding to Button control;
After being instantiated to initial EditText controls and initial deletion Button control, initial EditText is controlled Part and the initial attribute information for deleting Button control are configured.The length of initial EditText controls is namely set, initially The width of EditText controls, the initial length for deleting Button control, the initial width for deleting Button control, initial EditText controls Part length ratio shared in interface, it is initial to delete Button control length ratio shared in interface, initially delete The source of picture corresponding to Button control, the initial picture filling mode for deleting picture corresponding to Button control, initially EditText controls position in interface, the initial position for deleting Button control in interface.
In embodiments of the present invention, picture of the picture for cross and the figure to hook corresponding to Button control are initially deleted Piece, or other pictures, the embodiment of the present invention are not particularly limited to it.
S204, loaded in middle EditText controls and middle delete on Button control based on label array object OnTextChanged methods and afterTextChanged methods, obtain target widget, to be controlled to the length for inputting word System, wherein, onTextChanged methods and afterTextChanged methods are the side being controlled to the length for inputting word Method.
After middle EditText controls and middle deletion Button control is obtained, in middle EditText controls and centre Target control can just be obtained by deleting loading onTextChanged methods and afterTextChanged methods on Button control Part.
Alternatively, with reference to figure 3, onTextChanged methods the length for inputting word is controlled including:
S301, judge to input the length of word in input process;
OnTextChanged methods be in input process input word length monitoring, real-time judge input process The length of middle input word.
If S302, the length of input word are less than minimum character length or the length of input word is more than maximum character Length, then the color for setting input word is the first color, and it is the first picture to set picture corresponding to deletion Button control, Wherein, the first color is used to represent that the length of input word is illegal, and click event is loaded with the first picture, defeated for removing Enter word;
If the length of input word is less than minimum character length or the length of input word is more than maximum character length, That is, the length that the length violation conjunction of input word is pre-set, that is, the length of input word are illegal, then, The color for inputting word is the first color, and in embodiments of the present invention, the first color is red, or other colors, this Inventive embodiments are not particularly limited to it.
Also, it is the first picture, in embodiments of the present invention, first now to set picture corresponding to deleting Button control Picture is the picture of cross, and the embodiment of the present invention is not particularly limited to the content of the first picture.
Meanwhile first is loaded with click event on picture, when user clicks on the first picture, just can quickly remove Input word in EditText (i.e. input frame).
If S303, inputting the length of word more than minimum character length and being less than maximum character length, input is set The color of word is the second color, and it is second picture to set picture corresponding to deletion Button control, wherein, the second color is used It is legal in the length for representing input word.
If the length of input word is more than minimum character length and is less than maximum character length, then, input text is set The color of word is the second color, and in embodiments of the present invention, the second color is blueness, or other colors, the present invention are real Example is applied to be not particularly limited it.
Also, it is second picture, in embodiments of the present invention, second now to set picture corresponding to deleting Button control Picture is the picture to hook, and the embodiment of the present invention is not particularly shown to the content of second picture.
Alternatively, afterTextChanged methods to input word length be controlled including:
When the length of input word reaches maximum character length during end of input, inputted corresponding to interception maximum character length Word is into EditText controls.
The monitoring of the length of word is inputted when afterTextChanged methods are to end of input.It should be noted that OnTextChanged methods and afterTextChanged methods in the embodiment of the present invention with it is of the prior art The function phase of onTextChanged methods and afterTextChanged methods is same.
The implementation method of the input frame input control of the present invention realizes the function of addition input limitation and deletion action, energy It is enough that simple or complicated application scenarios are adapted to, separated with the logic of other controls in interface, code is simple, makes With conveniently.
Embodiment two:
A kind of realization device of input frame input control, with reference to figure 4, the device includes:
First acquisition module 20, for obtaining the target widget pre-set, wherein, target widget is used for input frame Input is controlled, and target widget includes:Target EditText controls and target delete Button control;
Add module 21, for target widget to be added into interface by targeted manner, obtain with target widget Interface, wherein, targeted manner includes following any:AddView mode, quote the mode of xml topology files;
Load-on module 22 is rendered, for rendering the interface with target widget on screen, and other controls is loaded, obtains Target interface.
In the realization device of the input frame input control of the present invention, the target widget pre-set, the target are directly obtained Control already has the function that the input to input frame is controlled, and without adding the logic of correlation again, then, passes through mesh Target widget is added on interface by mark mode, obtains the interface with target widget, finally, is rendered on screen with target The interface of control, and other controls are loaded, obtain target interface.In the realization device of the input frame input control of the present invention, lead to Cross targeted manner directly the target widget being controlled with the input to input frame is added on interface, without again to control It is configured, with regard to the target widget in target interface can be made to have the function of input control, simple and convenient, code is succinct, simultaneously Separated with the logic of other controls in target interface, improve the degree of coupling that interface redirects relevant treatment, alleviated existing In the realization device of some input frame input control, the cumbersome redundancy of code be present, the relevant treatment degree of coupling that interface redirects is low Technical problem.
Alternatively, the device also includes:
Second acquisition module, for obtaining initial control, wherein, initial control includes:Initial EditText controls and just Begin to delete Button control;
Setup module, for being configured to initial control, obtain target widget.
Alternatively, setup module includes:
Acquiring unit, for obtaining the label array object pre-set, wherein, most small character is included in label array object The information of length is accorded with, the information of maximum character length, the text information of display is given tacit consent to, deletes picture letter corresponding to Button control Breath;
Instantiating unit, for instantiating initial EditText controls and initial deletion Button control;
Setting unit, for being set to initial EditText controls and the initial attribute information for deleting Button control Put, obtain middle EditText controls and middle deletion Button control, wherein, attribute information comprises at least:Initially The length of EditText controls, the width of initial EditText controls, the initial length for deleting Button control are initial to delete Button controls The width of part, initial EditText controls length ratio shared in interface, initial Button control of deleting is shared by interface Length ratio, the initial source for deleting picture corresponding to Button control;
Loading unit, for deleting Button control in middle EditText controls and centre based on label array object OnTextChanged methods and afterTextChanged methods are loaded, obtains target widget, to enter to the length for inputting word Row control, wherein, onTextChanged methods and afterTextChanged methods are that the length for inputting word is controlled Method.
Alternatively, loading unit is additionally operable to:
Judge the length of input word in input process;
If the length of input word is less than minimum character length or the length of input word is more than maximum character length, The color for then setting input word is the first color, and it is the first picture to set picture corresponding to deletion Button control, wherein, First color is used to represent that the length of input word is illegal, click event is loaded with the first picture, for removing input text Word;
If the length of input word is more than minimum character length and is less than maximum character length, input word is set Color is the second color, and it is second picture to set picture corresponding to deletion Button control, wherein, the second color is used to represent The length for inputting word is legal.
Alternatively, loading unit is additionally operable to:
When the length of input word reaches maximum character length during end of input, inputted corresponding to interception maximum character length Word is into EditText controls.
Embodiment three:
The embodiments of the invention provide a kind of electronic equipment, and with reference to figure 5, the electronic equipment includes:Processor 30, memory 31, bus 32 and communication interface 33, processor 30, communication interface 33 and memory 31 are connected by bus 32;Processor 30 is used In performing the executable module that is stored in memory 31, such as computer program.Computing device is extreme and realizes such as during program The step of method described in embodiment of the method.
Wherein, memory 31 may include high-speed random access memory (RAM, RandomAccessMemory), also may be used Non-labile memory (non-volatile memory), for example, at least a magnetic disk storage can also be included.By at least One communication interface 33 (can be wired or wireless) realizes the communication between the system network element and at least one other network element Connection, can use internet, wide area network, LAN, Metropolitan Area Network (MAN) etc..
Bus 32 can be isa bus, pci bus or eisa bus etc..It is total that bus can be divided into address bus, data Line, controlling bus etc..For ease of representing, only represented in Fig. 5 with a four-headed arrow, it is not intended that an only bus or one The bus of type.
Wherein, memory 31 is used for storage program, and processor 30 is after execute instruction is received, configuration processor, foregoing The method performed by device that the stream process that inventive embodiments any embodiment discloses defines can apply in processor 30, or Person is realized by processor 30.
Processor 30 is probably a kind of IC chip, has the disposal ability of signal.In implementation process, above-mentioned side Each step of method can be completed by the integrated logic circuit of the hardware in processor 30 or the instruction of software form.Above-mentioned Processor 30 can be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network Processor (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (Digital Signal Processing, abbreviation DSP), application specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC), ready-made programmable gate array (Field-Programmable Gate Array, abbreviation FPGA) or other are programmable Logical device, discrete gate or transistor logic, discrete hardware components.It can realize or perform in the embodiment of the present invention Disclosed each method, step and logic diagram.General processor can be microprocessor or the processor can also be appointed What conventional processor etc..The step of method with reference to disclosed in the embodiment of the present invention, can be embodied directly in hardware decoding processing Device performs completion, or performs completion with the hardware in decoding processor and software module combination.Software module can be located at Machine memory, flash memory, read-only storage, programmable read only memory or electrically erasable programmable memory, register etc. are originally In the ripe storage medium in field.The storage medium is located at memory 31, and processor 30 reads the information in memory 31, with reference to Its hardware completes the step of above method.
The computer journey of implementation method, device and electronic equipment that the input frame input that the embodiment of the present invention is provided controls Sequence product, including the computer-readable recording medium of program code is stored, the instruction that described program code includes can be used for holding Method described in row previous methods embodiment, specific implementation can be found in embodiment of the method, will not be repeated here.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description With the specific work process of device, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
In addition, in the description of the embodiment of the present invention, unless otherwise clearly defined and limited, term " installation ", " phase Even ", " connection " should be interpreted broadly, for example, it may be being fixedly connected or being detachably connected, or be integrally connected;Can To be mechanical connection or electrical connection;Can be joined directly together, can also be indirectly connected by intermediary, Ke Yishi The connection of two element internals.For the ordinary skill in the art, with concrete condition above-mentioned term can be understood at this Concrete meaning in invention.
If the function is realized in the form of SFU software functional unit and is used as independent production marketing or in use, can be with It is stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially in other words The part to be contributed to prior art or the part of the technical scheme can be embodied in the form of software product, the meter Calculation machine software product is stored in a storage medium, including some instructions are causing a computer equipment (can be People's computer, server, or network equipment etc.) perform all or part of step of each embodiment methods described of the present invention. And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-OnlyMemory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with the medium of store program codes.
In the description of the invention, it is necessary to explanation, term " " center ", " on ", " under ", "left", "right", " vertical ", The orientation or position relationship of the instruction such as " level ", " interior ", " outer " be based on orientation shown in the drawings or position relationship, merely to Be easy to the description present invention and simplify description, rather than instruction or imply signified device or element must have specific orientation, With specific azimuth configuration and operation, therefore it is not considered as limiting the invention.In addition, term " first ", " second ", " the 3rd " is only used for describing purpose, and it is not intended that instruction or hint relative importance.
Finally it should be noted that:Embodiment described above, it is only the embodiment of the present invention, to illustrate the present invention Technical scheme, rather than its limitations, protection scope of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hair It is bright to be described in detail, it will be understood by those within the art that:Any one skilled in the art The invention discloses technical scope in, it can still modify to the technical scheme described in previous embodiment or can be light Change is readily conceivable that, or equivalent substitution is carried out to which part technical characteristic;And these modifications, change or replacement, do not make The essence of appropriate technical solution departs from the spirit and scope of technical scheme of the embodiment of the present invention, should all cover the protection in the present invention Within the scope of.Therefore, protection scope of the present invention described should be defined by scope of the claims.

Claims (10)

1. a kind of implementation method of input frame input control, it is characterised in that methods described includes:
The target widget pre-set is obtained, wherein, the input that the target widget is used for input frame is controlled, the mesh Mark control includes:Target EditText controls and target delete Button control;
The target widget is added on interface by targeted manner, obtains the interface with the target widget, wherein, institute Targeted manner is stated including following any:AddView mode, quote the mode of xml topology files;
The interface with the target widget is rendered on screen, and loads other controls, obtains target interface.
2. according to the method for claim 1, it is characterised in that before the target widget pre-set is obtained, the side Method also includes:
Initial control is obtained, wherein, the initial control includes:Initial EditText controls and initial deletion Button control;
The initial control is configured, obtains the target widget.
3. according to the method for claim 2, it is characterised in that the initial control is configured, obtains the target Control includes:
The label array object that pre-sets is obtained, wherein, the information of minimum character length is included in the label array object, The information of maximum character length, give tacit consent to the text information of display, pictorial information corresponding to the deletion Button control;
Instantiate the initial EditText controls and the initial deletion Button control;
The initial EditText controls and the initial attribute information for deleting Button control are configured, obtain centre EditText controls and middle deletion Button control, wherein, the attribute information comprises at least:The initial EditText controls The length of part, the width of the initial EditText controls, the initial length for deleting Button control, the initial deletion Button The width of control, initial EditText controls length ratio shared in interface, the initial Button control of deleting exist Shared length ratio in interface, the initial source for deleting picture corresponding to Button control;
Loaded based on the label array object in the middle EditText controls and middle delete on Button control OnTextChanged methods and afterTextChanged methods, obtain the target widget, to enter to the length for inputting word Row control, wherein, the onTextChanged methods and the afterTextChanged methods are the length to inputting word The method being controlled.
4. according to the method for claim 3, it is characterised in that length of the onTextChanged methods to input word Degree be controlled including:
Judge the length of input word in input process;
If the length of the input word is less than the length of the minimum character length or the input word more than described Maximum character length, then the color for setting the input word is the first color, and sets the deletion Button control corresponding Picture be the first picture, wherein, first color be used for represent it is described input word length it is illegal, first figure Click event is loaded with piece, for removing the input word;
If the length of the input word is more than the minimum character length and is less than the maximum character length, institute is set The color for stating input word is the second color, and it is second picture to set picture corresponding to the deletion Button control, wherein, Second color is used to represent that the length of the input word is legal.
5. according to the method for claim 3, it is characterised in that the afterTextChanged methods are to input word Length be controlled including:
When the length of the input word reaches the maximum character length during end of input, the maximum character length pair is intercepted The input word answered is into the EditText controls.
6. a kind of realization device of input frame input control, it is characterised in that described device includes:
First acquisition module, for obtaining the target widget pre-set, wherein, the target widget is used for the defeated of input frame Enter to be controlled, the target widget includes:Target EditText controls and target delete Button control;
Add module, for the target widget to be added into interface by targeted manner, obtain carrying the target widget Interface, wherein, the targeted manner include it is following any:AddView mode, quote the mode of xml topology files;
Load-on module is rendered, for rendering the interface with the target widget on screen, and other controls is loaded, obtains mesh Demarcate face.
7. device according to claim 6, it is characterised in that described device also includes:
Second acquisition module, for obtaining initial control, wherein, the initial control includes:Initial EditText controls and just Begin to delete Button control;
Setup module, for being configured to the initial control, obtain the target widget.
8. device according to claim 7, it is characterised in that the setup module includes:
Acquiring unit, for obtaining the label array object pre-set, wherein, most small character is included in the label array object The information of length is accorded with, the information of maximum character length, gives tacit consent to the text information of display, the deletion Button control is corresponding to scheme Piece information;
Instantiating unit, for instantiating the initial EditText controls and the initial deletion Button control;
Setting unit, for being carried out to the initial EditText controls and the initial attribute information for deleting Button control Set, obtain middle EditText controls and middle deletion Button control, wherein, the attribute information comprises at least:It is described The length of initial EditText controls, the width of the initial EditText controls, the initial length for deleting Button control are described The initial width for deleting Button control, initial EditText controls length ratio shared in interface are described initially to delete Except Button control length ratio shared in interface, the initial source for deleting picture corresponding to Button control;
Loading unit, for being deleted based on the label array object in the middle EditText controls and the centre OnTextChanged methods and afterTextChanged methods are loaded on Button control, the target widget is obtained, with right The length of input word is controlled, wherein, the onTextChanged methods and the afterTextChanged methods are The method being controlled to the length for inputting word.
9. device according to claim 8, it is characterised in that the loading unit is additionally operable to:
Judge the length of input word in input process;
If the length of the input word is less than the length of the minimum character length or the input word more than described Maximum character length, then the color for setting the input word is the first color, and sets the deletion Button control corresponding Picture be the first picture, wherein, first color be used for represent it is described input word length it is illegal, first figure Click event is loaded with piece, for removing the input word;
If the length of the input word is more than the minimum character length and is less than the maximum character length, institute is set The color for stating input word is the second color, and it is second picture to set picture corresponding to the deletion Button control, wherein, Second color is used to represent that the length of the input word is legal.
10. a kind of electronic equipment, including memory, processor, it is stored with and can runs on the processor on the memory Computer program, it is characterised in that realized described in the computing device during computer program in the claims 1 to 5 The step of method described in any one.
CN201710973671.XA 2017-10-18 2017-10-18 Implementation method, device and the electronic equipment of input frame input control Withdrawn CN107861782A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710973671.XA CN107861782A (en) 2017-10-18 2017-10-18 Implementation method, device and the electronic equipment of input frame input control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710973671.XA CN107861782A (en) 2017-10-18 2017-10-18 Implementation method, device and the electronic equipment of input frame input control

Publications (1)

Publication Number Publication Date
CN107861782A true CN107861782A (en) 2018-03-30

Family

ID=61697254

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710973671.XA Withdrawn CN107861782A (en) 2017-10-18 2017-10-18 Implementation method, device and the electronic equipment of input frame input control

Country Status (1)

Country Link
CN (1) CN107861782A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101859245A (en) * 2009-04-09 2010-10-13 北大方正集团有限公司 Method and device for generating user interface
JP2013156636A (en) * 2012-01-31 2013-08-15 Samsung Electronics Co Ltd Display device and additional information provision method using the same
WO2016082476A1 (en) * 2014-11-25 2016-06-02 中兴通讯股份有限公司 Service testing method and apparatus
CN105988814A (en) * 2015-03-02 2016-10-05 腾讯科技(深圳)有限公司 Interface generation method and apparatus
CN107203372A (en) * 2016-03-18 2017-09-26 百度在线网络技术(北京)有限公司 Control shows method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101859245A (en) * 2009-04-09 2010-10-13 北大方正集团有限公司 Method and device for generating user interface
JP2013156636A (en) * 2012-01-31 2013-08-15 Samsung Electronics Co Ltd Display device and additional information provision method using the same
WO2016082476A1 (en) * 2014-11-25 2016-06-02 中兴通讯股份有限公司 Service testing method and apparatus
CN105988814A (en) * 2015-03-02 2016-10-05 腾讯科技(深圳)有限公司 Interface generation method and apparatus
CN107203372A (en) * 2016-03-18 2017-09-26 百度在线网络技术(北京)有限公司 Control shows method and device

Similar Documents

Publication Publication Date Title
DE102012109959B4 (en) Automatic enlargement and selection confirmation
US20170083495A1 (en) Method for Modifying Webpage and Apparatus for Modifying Webpage
DE102013102285A1 (en) User interface navigation using pressure-sensitive touch
US20160210632A1 (en) Secured payment method and relevant device and system
US20120072978A1 (en) Desired Font Rendering
US10860164B2 (en) Information input method and apparatus
CN107480153A (en) A kind of page data processing method, client and terminal device
CN106503111B (en) Webpage code-transferring method, device and client terminal
CN108647348A (en) Textual presentation method, apparatus, equipment and storage medium
CN107315682A (en) Test browser-safe method, device, storage medium and electronic equipment
CN106888086B (en) System and method for managing account password
CN108255936A (en) A kind of edit methods of webpage, system and editing machine
WO2017186177A1 (en) Resource numerical value transfer request generating method, device and system, and storage medium
CN112130951A (en) AI-based RPA flow generation end flow generation method, equipment and storage medium
WO2022199370A1 (en) Eye protection prompting method and apparatus, storage medium, and computer device
CN109871205B (en) Interface code adjustment method, device, computer device and storage medium
CN114036501A (en) APP detection method, system, device, equipment and storage medium
CN113407254A (en) Form generation method and device, electronic equipment and storage medium
CN107861782A (en) Implementation method, device and the electronic equipment of input frame input control
CN107688650A (en) A kind of web page generation method and device
CN107147732A (en) Image processing method, device, client and service end
CN115098217B (en) Application page rendering method, device, equipment, readable medium and program product
CN115510508A (en) Page information protection method and device and electronic equipment
CN109492146A (en) A kind of method and apparatus of anti-WEB crawler
CN110262856B (en) Application program data acquisition method, device, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20180330

WW01 Invention patent application withdrawn after publication