CN107247543A - A kind of control layout method and device - Google Patents
A kind of control layout method and device Download PDFInfo
- Publication number
- CN107247543A CN107247543A CN201710455947.5A CN201710455947A CN107247543A CN 107247543 A CN107247543 A CN 107247543A CN 201710455947 A CN201710455947 A CN 201710455947A CN 107247543 A CN107247543 A CN 107247543A
- Authority
- CN
- China
- Prior art keywords
- layout
- control
- definition
- pixel value
- field
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 34
- 239000004744 fabric Substances 0.000 claims description 15
- 230000008859 change Effects 0.000 claims description 9
- 230000000694 effects Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0481—Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
- G06F3/0483—Interaction with page-structured environments, e.g. book metaphor
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)
- Control Of Indicators Other Than Cathode Ray Tubes (AREA)
Abstract
The invention provides a kind of control layout method and device, this method includes:Obtain the pixel value of the display width of current interface layout areas, determine the target field layout definition corresponding with the pixel value at least one default field layout definition, according to the regular and described target field layout definition in default control display location, control layout is carried out to current interface layout areas.When the resolution ratio in interface layout region is different, the pixel value of its display width is different, based on the pixel value to carry out control layout, and this implementation causes control layout to be adapted with each resolution ratio.Therefore, this programme can improve the adaptability for different resolution.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of control layout method and device.
Background technology
With the variation of subscriber terminal equipment species, user's display interface needs the resolving range supported also increasingly
Extensively.Such as, the resolution ratio of mobile terminal device can be from 320p to 1080p, PC (personal computer, individual's meter
Calculation machine) resolution ratio of equipment can be from 1024 × 768 to 4k.Wherein, the control layout of graphical interface of user generally should be with
The resolution ratio of subscriber terminal equipment matches, adapted to.
At present, for different resolution, different control layout schemes can be defined.
Due to needing specific control layout scheme, therefore existing implementation is relatively low for the adaptability of different resolution.
The content of the invention
The invention provides a kind of control layout method and device, it is possible to increase for the adaptability of different resolution.
In order to achieve the above object, the present invention is achieved through the following technical solutions:
On the one hand, the invention provides a kind of control layout method, control display location rule and at least one column are determined
Position layout definition, in addition to:
Obtain the first pixel value of the display width of current interface layout areas;
It is determined that the target field layout corresponding with first pixel value at least one described field layout definition
Definition;
According to the regular and described target field layout definition in the control display location, current interface layout areas is carried out
Control layout.
Further, each field layout definition at least one described field layout definition includes:Field cloth
It is any one or more in office's mark, screen width scope, the total columns of layout;
Wherein, the screen width scope is (W1,W2], wherein, W1For the pixel value of minimum screen width, W2For maximum
The pixel value of screen width;
Control display location rule includes:Each control mark for treating layout control, layout order, layout are shared
It is any one or more in columns.
Further, it is corresponding with first pixel value at least one field layout definition described in the determination
Target field layout definition, including:Judge to whether there is any field layout definition at least one described field layout definition,
So that first pixel value is located in the range of the screen width that the field layout definition includes, if so, determining that the field is laid out
It is defined as target field layout definition.
Further, it is described according to the regular and described target field layout definition in the control display location, to working as prezone
Face layout areas carries out control layout, including:Treat that layout control is performed both by for each:Judge that this treats the layout of layout control
Whether shared columns is more than the total columns of layout of the target field layout definition, if so, this to be treated to the layout institute of layout control
Account for the total columns of layout that columns is changed to the target field layout definition, and according to the columns of gained after change, this waits to be laid out
Control control mark and layout order, and the target field layout definition the total columns of layout, to current interface be laid out
Region carries out control layout;Otherwise, the columns according to shared by this treats control mark, layout order and the layout of layout control, and
The total columns of layout of the target field layout definition, control layout is carried out to current interface layout areas.
Further, it is described to current interface layout areas progress control layout, including:This is treated that layout control is filled in
In current interface layout areas, so that the pixel value of the display width for treating layout control meets formula one;
The formula one includes:
X=n × A/N-X0×A/A0
Wherein, X for this treat layout control display width pixel value, n treats columns shared by the layout of layout control for this,
A is first pixel value, and N is the total columns of layout of the target field layout definition, X0For the default and target column
The corresponding left margin standard edge of position layout definition is away from the pixel value sum with right zero standard back gauge, A0For it is default with it is described
The corresponding standard pixel value of target field layout definition.
On the other hand, the invention provides a kind of control layout device, including:
First determining unit, for determining control display location rule and at least one field layout definition;
Acquiring unit, the first pixel value of the display width for obtaining current interface layout areas;
Second determining unit, it is relative with first pixel value at least one described field layout definition for determining
The target field layout definition answered;
Processing unit, for according to the regular and described target field layout definition in the control display location, to working as prezone
Face layout areas carries out control layout.
Further, each field layout definition at least one described field layout definition includes:Field cloth
It is any one or more in office's mark, screen width scope, the total columns of layout;
Wherein, the screen width scope is (W1,W2], wherein, W1For the pixel value of minimum screen width, W2For maximum
The pixel value of screen width;
Control display location rule includes:Each control mark for treating layout control, layout order, layout are shared
It is any one or more in columns.
Further, second determining unit, specifically for judge at least one described field layout definition whether
There is any field layout definition, so that first pixel value is located at the screen width scope that the field layout definition includes
It is interior, if so, determining that the field layout definition is target field layout definition.
Further, the processing unit, specifically for treating that layout control is performed both by for each:Judge that this waits to be laid out
Whether columns shared by the layout of control is more than the total columns of layout of the target field layout definition, if so, this is treated into layout control
Columns shared by the layout of part is changed to the total columns of layout of the target field layout definition, and according to the row of gained after change
Number, this treat layout control controls mark and layout order, and the target field layout definition the total columns of layout, to work as
Front interface layout areas carries out control layout;Otherwise, according to shared by this treats control mark, layout order and the layout of layout control
Columns, and the target field layout definition the total columns of layout, to current interface layout areas carry out control layout.
Further, the processing unit, specifically for this is treated into layout control is filled in current interface layout areas,
So that the pixel value of the display width for treating layout control meets formula one;
The formula one includes:
X=n × A/N-X0×A/A0
Wherein, X for this treat layout control display width pixel value, n treats columns shared by the layout of layout control for this,
A is first pixel value, and N is the total columns of layout of the target field layout definition, X0For the default and target column
The corresponding left margin standard edge of position layout definition is away from the pixel value sum with right zero standard back gauge, A0For it is default with it is described
The corresponding standard pixel value of target field layout definition.
The invention provides a kind of control layout method and device, the picture of the display width of current interface layout areas is obtained
Element value, determines the target field layout definition corresponding with the pixel value at least one default field layout definition,
According to the regular and described target field layout definition in default control display location, control cloth is carried out to current interface layout areas
Office.When the resolution ratio in interface layout region is different, the pixel value of its display width is different, based on the pixel value to carry out control
Layout, this implementation causes control layout to be adapted with each resolution ratio.Therefore, the present invention can be improved differentiates for different
The adaptability of rate.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are the present invention
Some embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis
These accompanying drawings obtain other accompanying drawings.
Fig. 1 is a kind of flow chart for control layout method that one embodiment of the invention is provided;
Fig. 2 is the flow chart for another control layout method that one embodiment of the invention is provided;
Fig. 3 is a kind of control layout schematic diagram at expense report interface that one embodiment of the invention is provided;
Fig. 4 is the control layout schematic diagram at another expense report interface that one embodiment of the invention is provided;
Fig. 5 is the control layout schematic diagram at another expense report interface that one embodiment of the invention is provided;
Fig. 6 is a kind of schematic diagram for control layout device that one embodiment of the invention is provided.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
A part of embodiment of the present invention, rather than whole embodiments, based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained on the premise of creative work is not made, belongs to the scope of protection of the invention.
As shown in figure 1, the embodiments of the invention provide a kind of control layout method, may comprise steps of:
Step 101:Determine control display location rule and at least one field layout definition.
Step 102:Obtain the first pixel value of the display width of current interface layout areas.
Step 103:It is determined that the target corresponding with first pixel value at least one described field layout definition
Field layout definition.
Step 104:According to the regular and described target field layout definition in the control display location, current interface is laid out
Region carries out control layout.
The embodiments of the invention provide a kind of control layout method, the picture of the display width of current interface layout areas is obtained
Element value, determines the target field layout definition corresponding with the pixel value at least one default field layout definition,
According to the regular and described target field layout definition in default control display location, control cloth is carried out to current interface layout areas
Office.When the resolution ratio in interface layout region is different, the pixel value of its display width is different, based on the pixel value to carry out control
Layout, this implementation causes control layout to be adapted with each resolution ratio.Therefore, the embodiment of the present invention can be improved for not
With the adaptability of resolution ratio.
In one embodiment of the invention, each field layout definition at least one described field layout definition
Include:It is any one or more in field layout mark, screen width scope, the total columns of layout;
Wherein, the screen width scope is (W1,W2], wherein, W1For the pixel value of minimum screen width, W2For maximum
The pixel value of screen width;
Control display location rule includes:Each control mark for treating layout control, layout order, layout are shared
It is any one or more in columns.
In detail, the specific value of each screen width scope can be determined according to user's request.
Preferably, in an embodiment of the invention, each field layout definition includes:Field layout mark, screen are wide
Spend scope, be laid out total columns.For example, the 3 field layout definitions determined can be as described in table 1 below:
Table 1
Field layout mark | Screen width scope (px) | It is laid out total columns |
MinLayout | (0,1024] | 1 |
MediumLayout | (1024,1920] | 3 |
MaxLayout | (1920,2560] | 6 |
From the foregoing, it will be observed that the screen width scope of adjacent field layout definition is continuously, such as, screen width scope (0,
1024] maximum screen width and screen width scope (1024,1920] minimum screen width it is equal.Certainly, in the present invention
In another embodiment, based on different practical application requests, the screen width scope of adjacent field layout definition equally can be
Discontinuously, such as, it is determined that field layout definition can be 2, and both screen width scope can be respectively (0,
1024]、(1920,2560]。
Preferably, in an embodiment of the invention, control display location rule treats the control of layout control including each
The shared columns of part mark, layout order, layout.For example, the control display location rule determined can be as described in table 2 below:
Table 2
In an embodiment of the invention, it is generally the case that treat layout control layout order follow first from left to right, then
Principle from top to bottom.Therefore, when the remaining columns of the layout of current line be not enough to layout it is next whne layout control when, this treats cloth
Office's control, which is postponed to the leftmost side of next line, to be laid out.Such as, when the total columns of layout is 4, before in the complete table 2 of sequential placement
During three controls, still residue one is arranged, but columns shared by the layout of the 4th control is 3, therefore the 4th control can be in the layout of down
The leftmost side of a line.
In an embodiment of the invention, it is determined that control display location rule can equally include each control mark pair
The control implication answered.Such as, ctrlCode control implication is reimbursement odd numbers;CtrlType control implication is reimbursement type;
CtrlSum control implication is reimbursed sum;CtrlNote control implication is reimbursement explanation;CtrlPerson control implication
For claimer;CtrlDept control implication is reimbursement department;CtrlDate control implication is the reimbursement date.
In one embodiment of the invention, in order to illustrate a kind of possibility realization side for determining target field layout definition
Formula, so, the target field corresponding with first pixel value at least one field layout definition described in the determination
Layout definition, including:Judge to whether there is any field layout definition at least one described field layout definition, so that described
First pixel value is located in the range of the screen width that the field layout definition includes, if so, determining that the field layout definition is mesh
Mark field layout definition.
Such as, based on above-mentioned table 1, when the first pixel value got is 1920, it is located at screen through judging to understand, 1920
Width range (1024,1920] in, then second field layout definition in table 1 is target field layout definition.In this way, working as needs
When carrying out control layout in any interface layout region, it can be laid out according to the field that the interface layout region matches
Definition is laid out, so that control layout and the resolution ratio in interface layout region are adapted.
In one embodiment of the invention, include when the first pixel value got is not located at any field layout definition
Screen width in the range of when, it may be determined that go out the screen width scope closest with it, and then determine target field cloth
Office's definition.Such as, if the first pixel value is 4000, it is not located in the range of any screen width, then can determine with it the most
Close screen width scope for (1920,2560], thus can determine the 3rd field layout definition in table 1 be target field
Layout definition.
In one embodiment of the invention, it is laid out to illustrate that columns shared by a kind of layout is more than at the possibility of total columns
Reason mode, so, it is described according to the regular and described target field layout definition in the control display location, current interface is laid out
Region carries out control layout, including:Treat that layout control is performed both by for each:Judge that this treats the shared row of the layout of layout control
Whether number is more than the total columns of layout of the target field layout definition, if so, this is treated into columns shared by the layout of layout control
Be changed to the total columns of layout of the target field layout definition, and according to the columns of gained after change, this treat layout control
Control identify and layout order, and the target field layout definition the total columns of layout, current interface layout areas is entered
Row control layout;Otherwise, the columns according to shared by this treats control mark, layout order and the layout of layout control, and the mesh
The total columns of layout of field layout definition is marked, control layout is carried out to current interface layout areas.
Such as, if the first pixel value is 1024, the total columns of layout of target field layout definition is the in 1, but table 2
Columns shared by the layout of four controls is 3, therefore columns shared by the layout can be changed into 1.
In this way, if the first pixel value is 1024, it is 1 to be laid out total columns, by being laid out to seven controls in table 2,
Seven rows can be distributed with current interface layout areas from top to bottom, and there are seven controls, and each control in this seven rows sequential placement
Columns shared by the layout of part is 1.
In one embodiment of the invention, in order to illustrate a kind of possible control layout implementation, so, it is described to current
Interface layout region carries out control layout, including:This is treated that layout control is filled in current interface layout areas, so that this is treated
The pixel value of the display width of layout control meets following formula (1);
X=n × A/N-X0×A/A0 (1)
Wherein, X for this treat layout control display width pixel value, n treats columns shared by the layout of layout control for this,
A is first pixel value, and N is the total columns of layout of the target field layout definition, X0For the default and target column
The corresponding left margin standard edge of position layout definition is away from the pixel value sum with right zero standard back gauge, A0For it is default with it is described
The corresponding standard pixel value of target field layout definition.
In detail, can preset the corresponding left margin standard edge of different field layout definitions away from right zero standard back gauge
Pixel value sum, and the corresponding standard pixel value of default different field layout definitions.Such as, can be with first in preset table 1
The corresponding X of individual field layout definition0=150+150=300, wherein, left margin standard edge is away from the picture with right zero standard back gauge
Plain value is 150, A0=1024;The corresponding X of second field layout definition in table 10=100+100=200, wherein, left sky
White standard edge is 100, A away from the pixel value with right zero standard back gauge0=1920;The 3rd field layout definition in table 1
Corresponding X0=50+50=100, wherein, left margin standard edge is 50, A away from the pixel value with right zero standard back gauge0=
2560.Because left margin standard edge is away from equal with the pixel value of right zero standard back gauge, therefore the filling mode of control layout can be with
For filling placed in the middle.
For example, if the first pixel value is 1920, target field layout definition is second field layout in table 2
Definition, then it is 3 to be laid out total columns, so that the pixel value of the col width of each row can be 640, i.e. 1920/3=640.With in table 2
First treat layout control exemplified by, be computed, the pixel value of the display width of the control for X=1 × 1920/3-200 ×
1920/1920=440, therefore the control can be filled in the first row of the first row of current interface layout areas between two parties.Based on
The column border of one row, the pixel value of the left margin back gauge of the control is 100, right lay edges away from pixel value be 100, the control
The pixel value of display width is 440.
On the other hand, when the first pixel value be positioned at screen width scope (1024,1920] in any in addition to 1920
During numerical value, such as 1440 when, then target field layout definition is second field layout definition in table 2, then is laid out total row
Number is 3, so that the pixel value of the col width of each row can be 480, i.e. 1440/3=480.Layout control is treated with first in table 2
Exemplified by part, it is computed, the pixel value of the display width of the control is X=1 × 1440/3-200 × 1440/1920=330, left
Lay edges away from pixel value be 75=100 × 1440/1920, right lay edges away from pixel value be 75=100 × 1440/1920.
The control can be filled in the first row of the first row of current interface layout areas between two parties.Column border based on first row, the control
The pixel value of the left margin back gauge of part is 75, right lay edges away from pixel value be 75, the pixel value of the display width of the control is
330。
As shown in the above, it is identical for the physical size of display width, but the different multiple interface layouts of resolution ratio
Region, because the pixel value of the display width of each control changes with the change of resolution ratio, therefore completes gained after control layout
Control layout effect can be consistent, i.e., the physical size of the display width of each control is consistent.Herein on basis, by
Each column average in interface layout region is distributed, and control is laid out in the way of filling, and this implementation ensure that
Control layout is in good order, improves layout whole structure.
As shown in Fig. 2 one embodiment of the invention provides another control layout method, this method is with expense report interface
Exemplified by essential information interface, following steps are specifically included:
Step 201:Determine control display location rule and 3 field layout definitions.
In detail, it is determined that 3 field layout definitions can as shown in Table 1 above, it is determined that control display location rule
Can be as shown in Table 2 above.At the same time it can also determine that each control identifies corresponding control implication, and this correspondence is closed
System can refer to the above.
Step 202:Obtain the first pixel value of the display width of current interface layout areas.
As an example it is assumed that the pixel value of the display width of current interface layout areas is 1920, therefore the can be got
One pixel value is 1920.
Step 203:Judge to whether there is any field layout definition in 3 field layout definitions, so that the first pixel value
In the range of the screen width that the field layout definition includes, if so, determining that the field layout definition is laid out for target field
Definition, and step 204 is performed, otherwise, perform abnormality processing and terminate current process.
With reference to above-mentioned table 1, it is known that pixel value 1920 is located in second field layout definition, i.e.,:Field layout is designated
MediumLayout, screen width scope for (1024,1920], it is 3 to be laid out total columns.
Step 204:Treat that layout control is performed both by for each:Judge whether this treats columns shared by the layout of layout control
More than the total columns of layout of target field layout definition, if so, performing step 206, otherwise, step 208 is performed.
As shown in the above, the total columns of the layout of target field layout definition is 3, and any control in above-mentioned table 2
Layout shared by columns no more than 3, therefore for any control, be performed both by step 208.
Step 206:This is treated that columns shared by the layout of layout control is changed to the layout of target field layout definition and always arranged
Number, and perform step 207.
Step 207:According to after change gained columns, this treat layout control control mark and layout order, Yi Jisuo
The total columns of layout of target field layout definition is stated, this is treated that layout control is filled in current interface layout areas, so that should
Treat that the pixel value of the display width of layout control meets preset formula, and terminate current process.
In detail, the preset formula can be above-mentioned formula (1).
Step 208:The columns according to shared by this treats control mark, layout order and the layout of layout control, and the mesh
The total columns of layout of field layout definition is marked, this is treated that layout control is filled in current interface layout areas, so that this treats cloth
The pixel value of the display width of office's control meets preset formula.
In detail, the preset formula can be above-mentioned formula (1).
In detail, if the pixel value of default left margin back gauge and right lay edges away from pixel value it is equal, control filling can
Think filling placed in the middle, accordingly, if both are unequal, control filling can carry out correspondence filling according to specific preset value.
Above-mentioned steps 201 be refer to step 208, and above-mentioned Tables 1 and 2, if the first pixel value got is position
In (1024,1920] in the range of any pixel value, then layout effect of each control in current interface layout areas can be as
Shown in Fig. 3.
In figure 3, shown horizontal dotted line can be the boundary line of different rows, and shown longitudinal dotted line can be the side of different lines
Boundary line, wherein, these horizontal dotted lines and longitudinal dotted line do not show in actual applications, are only illustrated as the embodiment of the present invention
It is used.The shared columns of control mark, control implication, layout order and layout based on each control, and total columns is laid out, use
The layout type of filling is laid out, and can obtain control layout result as shown in Figure 3, meanwhile, the display of each control is wide
The pixel value of degree can meet above-mentioned formula (1).
Similarly, if the first pixel value got be positioned at (0,1024] in the range of any pixel value, then each control exist
Layout effect in current interface layout areas can be as shown in Figure 4;If the first pixel value got be positioned at (1920,
2560] any pixel value in the range of, then layout effect of each control in current interface layout areas can be as shown in Figure 5.
Therefore not to repeat here for the embodiment of the present invention.
As shown in fig. 6, one embodiment of the invention provides a kind of control layout device, including:
First determining unit 601, for determining control display location rule and at least one field layout definition;
Acquiring unit 602, the first pixel value of the display width for obtaining current interface layout areas;
Second determining unit 603, for determine at least one described field layout definition with first pixel value
Corresponding target field layout definition;
Processing unit 604, for according to the regular and described target field layout definition in the control display location, to current
Interface layout region carries out control layout.
In an embodiment of the invention, each field layout definition at least one described field layout definition is equal
Including:It is any one or more in field layout mark, screen width scope, the total columns of layout;
Wherein, the screen width scope is (W1,W2], wherein, W1For the pixel value of minimum screen width, W2For maximum
The pixel value of screen width;
Control display location rule includes:Each control mark for treating layout control, layout order, layout are shared
It is any one or more in columns.
In an embodiment of the invention, second determining unit 603, specifically for judging at least one described field
It whether there is any field layout definition in layout definition, so that first pixel value is located at what the field layout definition included
In the range of screen width, if so, determining that the field layout definition is target field layout definition.
In an embodiment of the invention, the processing unit 604, specifically for treating that layout control is held for each
OK:Judge that this treats whether columns shared by the layout of layout control is more than the total columns of layout of the target field layout definition, if
It is that this is treated that columns shared by the layout of layout control is changed to the total columns of layout of the target field layout definition, and according to
The columns of gained after change, this treat the control mark and layout order of layout control, and the target field layout definition
Total columns is laid out, control layout is carried out to current interface layout areas;Otherwise, according to this treat layout control control mark, cloth
Office's order and the total columns of layout of columns shared by layout, and the target field layout definition, to current interface layout areas
Carry out control layout.
In an embodiment of the invention, the processing unit 604, specifically for this is treated into layout control is filled in currently
In interface layout region, so that the pixel value of the display width for treating layout control meets formula (1).
One embodiment of the invention provides a kind of computer-readable recording medium, including execute instruction, when the processor of storage control
When performing the execute instruction, the storage control performs any of the above-described described control layout method.
One embodiment of the invention provides a kind of storage control, including:Processor, memory and bus;
The memory is used to store execute instruction, and the processor is connected with the memory by the bus, when
During the storage control operation, the execute instruction of memory storage described in the computing device, so that the storage
Controller performs any of the above-described described control layout method.
The contents such as the information exchange between each unit, implementation procedure in said apparatus, due to implementing with the inventive method
Example is based on same design, and particular content can be found in the narration in the inventive method embodiment, and here is omitted.
In summary, each embodiment of the invention at least has the advantages that:
1st, in the embodiment of the present invention, obtain current interface layout areas display width pixel value, determine it is default extremely
The target field layout definition corresponding with the pixel value in a few field layout definition, shows according to default control
Location rule and the target field layout definition, control layout is carried out to current interface layout areas.When interface layout region
Resolution ratio it is different when, the pixel value of its display width is different, based on the pixel value to carry out control layout, this implementation
So that control layout is adapted with each resolution ratio.Therefore, the embodiment of the present invention can improve the adaptability for different resolution.
2nd, it is identical for the physical size of display width in the embodiment of the present invention, but the different multiple interface cloth of resolution ratio
Office region, because the pixel value of the display width of each control changes with the change of resolution ratio, therefore completes gained after control layout
Control layout effect can be consistent, i.e., the physical size of the display width of each control is consistent.Herein on basis,
Because each column average in interface layout region is distributed, and control is laid out in the way of filling, and this implementation can be protected
Demonstrate,prove control layout in good order, improve layout whole structure.
It should be noted that herein, such as first and second etc relational terms are used merely to an entity
Or operation makes a distinction with another entity or operation, and not necessarily require or imply exist between these entities or operation
Any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant be intended to it is non-
It is exclusive to include, so that process, method, article or equipment including a series of key elements not only include those key elements,
But also other key elements including being not expressly set out, or also include solid by this process, method, article or equipment
Some key elements.In the absence of more restrictions, by sentence " including the key element that a 〃 〃 " is limited, it is not excluded that
Also there is other identical factor in the process including the key element, method, article or equipment.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass through
Programmed instruction related hardware is completed, and foregoing program can be stored in the storage medium of embodied on computer readable, the program
Upon execution, the step of including above method embodiment is performed;And foregoing storage medium includes:ROM, RAM, magnetic disc or light
Disk etc. is various can be with the medium of store program codes.
It is last it should be noted that:Presently preferred embodiments of the present invention is the foregoing is only, the skill of the present invention is merely to illustrate
Art scheme, is not intended to limit the scope of the present invention.Any modification for being made within the spirit and principles of the invention,
Equivalent substitution, improvement etc., are all contained in protection scope of the present invention.
Claims (10)
1. a kind of control layout method, it is characterised in that determine control display location rule and at least one field layout definition,
Also include:
Obtain the first pixel value of the display width of current interface layout areas;
It is determined that the target field layout definition corresponding with first pixel value at least one described field layout definition;
According to the regular and described target field layout definition in the control display location, control is carried out to current interface layout areas
Layout.
2. according to the method described in claim 1, it is characterised in that
Each field layout definition at least one described field layout definition includes:Field layout mark, screen are wide
Spend any one or more in scope, the total columns of layout;
Wherein, the screen width scope is (W1,W2], wherein, W1For the pixel value of minimum screen width, W2It is wide for maximum screen
The pixel value of degree;
Control display location rule includes:The shared columns of each control mark for treating layout control, layout order, layout
In it is any one or more.
3. method according to claim 2, it is characterised in that
The target field layout corresponding with first pixel value at least one field layout definition described in the determination
Definition, including:Judge to whether there is any field layout definition at least one described field layout definition, so that described first
Pixel value is located in the range of the screen width that the field layout definition includes, if so, determining that the field layout definition is target column
Position layout definition.
4. according to the method in claim 2 or 3, it is characterised in that
It is described according to the regular and described target field layout definition in the control display location, current interface layout areas is carried out
Control layout, including:Treat that layout control is performed both by for each:Judge that this treats whether columns shared by the layout of layout control is big
In the total columns of layout of the target field layout definition, if so, this is treated into columns shared by the layout of layout control is changed to institute
State the total columns of layout of target field layout definition, and according to the columns of gained after change, this treat the control mark of layout control
And layout order, and the target field layout definition the total columns of layout, to current interface layout areas carry out control cloth
Office;Otherwise, the columns according to shared by this treats control mark, layout order and the layout of layout control, and the target field cloth
The total columns of layout of office's definition, control layout is carried out to current interface layout areas.
5. method according to claim 4, it is characterised in that
It is described to current interface layout areas carry out control layout, including:This is treated that layout control is filled in current interface layout
In region, so that the pixel value of the display width for treating layout control meets formula one;
The formula one includes:
X=n × A/N-X0×A/A0
Wherein, X for this treat layout control display width pixel value, n treats columns shared by the layout of layout control for this, and A is
First pixel value, N is the total columns of layout of the target field layout definition, X0For the default and target field cloth
Office defines corresponding left margin standard edge away from the pixel value sum with right zero standard back gauge, A0For the default and target
The corresponding standard pixel value of field layout definition.
6. a kind of control layout device, it is characterised in that including:
First determining unit, for determining control display location rule and at least one field layout definition;
Acquiring unit, the first pixel value of the display width for obtaining current interface layout areas;
Second determining unit, it is corresponding with first pixel value at least one described field layout definition for determining
Target field layout definition;
Processing unit, for according to the regular and described target field layout definition in the control display location, to current interface cloth
Office region carries out control layout.
7. control layout device according to claim 6, it is characterised in that
Each field layout definition at least one described field layout definition includes:Field layout mark, screen are wide
Spend any one or more in scope, the total columns of layout;
Wherein, the screen width scope is (W1,W2], wherein, W1For the pixel value of minimum screen width, W2It is wide for maximum screen
The pixel value of degree;
Control display location rule includes:The shared columns of each control mark for treating layout control, layout order, layout
In it is any one or more.
8. control layout device according to claim 7, it is characterised in that
Second determining unit, specifically for judging to whether there is any field cloth at least one described field layout definition
Office's definition, so that first pixel value is located in the range of the screen width that the field layout definition includes, if so, determining the column
Position layout definition is target field layout definition.
9. the control layout device according to claim 7 or 8, it is characterised in that
The processing unit, specifically for treating that layout control is performed both by for each:Judge that this treats the layout of layout control institute
The total columns of layout whether columns is more than the target field layout definition is accounted for, if so, this is treated shared by the layout of layout control
Columns is changed to the total columns of layout of the target field layout definition, and according to the columns of gained after change, this treat layout control
Part control mark and layout order, and the target field layout definition the total columns of layout, to current interface be laid out area
Domain carries out control layout;Otherwise, columns, Yi Jisuo according to shared by this treats control mark, layout order and the layout of layout control
The total columns of layout of target field layout definition is stated, control layout is carried out to current interface layout areas.
10. control layout device according to claim 9, it is characterised in that
The processing unit, specifically for this is treated into layout control is filled in current interface layout areas, so that this waits to be laid out
The pixel value of the display width of control meets formula one;
The formula one includes:
X=n × A/N-X0×A/A0
Wherein, X for this treat layout control display width pixel value, n treats columns shared by the layout of layout control for this, and A is
First pixel value, N is the total columns of layout of the target field layout definition, X0For the default and target field cloth
Office defines corresponding left margin standard edge away from the pixel value sum with right zero standard back gauge, A0For the default and target
The corresponding standard pixel value of field layout definition.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710455947.5A CN107247543A (en) | 2017-06-16 | 2017-06-16 | A kind of control layout method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710455947.5A CN107247543A (en) | 2017-06-16 | 2017-06-16 | A kind of control layout method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107247543A true CN107247543A (en) | 2017-10-13 |
Family
ID=60018480
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710455947.5A Pending CN107247543A (en) | 2017-06-16 | 2017-06-16 | A kind of control layout method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107247543A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109032749A (en) * | 2018-08-16 | 2018-12-18 | 成都市映潮科技股份有限公司 | A kind of adaptive terminal device resolution method and device |
CN109164999A (en) * | 2018-08-29 | 2019-01-08 | 郑州云海信息技术有限公司 | A kind of method, apparatus that table is adaptively shown, equipment and readable storage medium storing program for executing |
CN113610836A (en) * | 2021-08-20 | 2021-11-05 | 车主邦(北京)科技有限公司 | Control configuration method and device, computer readable medium and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101320365A (en) * | 2008-07-09 | 2008-12-10 | 金蝶软件(中国)有限公司 | Method and apparatus for dynamic layout of document page |
CN102929603A (en) * | 2012-09-28 | 2013-02-13 | 用友软件股份有限公司 | Interface control arrangement device and interface control arrangement method |
CN103336691A (en) * | 2013-06-29 | 2013-10-02 | 安科智慧城市技术(中国)有限公司 | Dynamic layout method and system based on Android |
CN103744595A (en) * | 2013-12-30 | 2014-04-23 | 广州华多网络科技有限公司 | Self-adaption display method and configuration file generating method and device |
-
2017
- 2017-06-16 CN CN201710455947.5A patent/CN107247543A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101320365A (en) * | 2008-07-09 | 2008-12-10 | 金蝶软件(中国)有限公司 | Method and apparatus for dynamic layout of document page |
CN102929603A (en) * | 2012-09-28 | 2013-02-13 | 用友软件股份有限公司 | Interface control arrangement device and interface control arrangement method |
CN103336691A (en) * | 2013-06-29 | 2013-10-02 | 安科智慧城市技术(中国)有限公司 | Dynamic layout method and system based on Android |
CN103744595A (en) * | 2013-12-30 | 2014-04-23 | 广州华多网络科技有限公司 | Self-adaption display method and configuration file generating method and device |
Non-Patent Citations (1)
Title |
---|
ADOBEMUSE中文教程: "8.响应式布局自适应 - adobe muse", 《优酷网, HTTPS://V.YOUKU.COM/V_SHOW/ID_XOTAXNTU4NJYW.HTML》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109032749A (en) * | 2018-08-16 | 2018-12-18 | 成都市映潮科技股份有限公司 | A kind of adaptive terminal device resolution method and device |
CN109032749B (en) * | 2018-08-16 | 2021-08-10 | 成都映潮科技股份有限公司 | Method and device for adapting resolution of terminal equipment |
CN109164999A (en) * | 2018-08-29 | 2019-01-08 | 郑州云海信息技术有限公司 | A kind of method, apparatus that table is adaptively shown, equipment and readable storage medium storing program for executing |
CN113610836A (en) * | 2021-08-20 | 2021-11-05 | 车主邦(北京)科技有限公司 | Control configuration method and device, computer readable medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107247543A (en) | A kind of control layout method and device | |
US9069437B2 (en) | Window management method, apparatus and computing device | |
CN107240384B (en) | Display brightness compensation method and device | |
US20180191371A1 (en) | Data compression and decompression method of demura table, and mura compensation method | |
CN102365611B (en) | Display control device, display control method, and touchpad input system | |
US20140149855A1 (en) | Character Segmenting Method and Apparatus for Web Page Pictures | |
DE102016211642A1 (en) | PATCH MEMORY SYSTEM | |
CN103914211A (en) | Automatic interface element adjusting method and automatic interface element adjusting device | |
CN104793945A (en) | Large-batch picture displaying method for preventing memory overflow and device thereof | |
JP4407875B2 (en) | CHARACTER DISPLAY DEVICE, CHARACTER DISPLAY METHOD, CONTROL PROGRAM FOR CONTROLLING THE CHARACTER DISPLAY METHOD, AND RECORDING MEDIUM CONTAINING THE CONTROL PROGRAM | |
Specht | High density packings of equal circles in rectangles with variable aspect ratio | |
CN104157256A (en) | Liquid crystal display and compensation method for display picture thereof | |
CN108153454A (en) | Multiple point touching switching method, device, storage medium and terminal device | |
CN111698491B (en) | Multi-projection image display method and device, electronic equipment and storage medium | |
CN113538623A (en) | Method and device for determining target image, electronic equipment and storage medium | |
JP2010056691A5 (en) | ||
CN105528769A (en) | Image repair method and system | |
US20120201479A1 (en) | Arranging Secondary Images Adjacent to a Primary Image | |
CN106775256A (en) | Icon is across screen sliding method and device | |
CN116168192A (en) | Image detection area determination method and device, electronic equipment and storage medium | |
US10331837B1 (en) | Device graphics rendering for electronic designs | |
CN103593822A (en) | Method and device carrying out frosted special efficacy treatment to data image | |
TWI722684B (en) | Computer-implemented methods and non-transitory computer storage media related to image processor complex transfer functions and computing devices employing an image processor | |
CN114222074A (en) | Spliced screen driving method and device, server and storage medium | |
US9367933B2 (en) | Layering a line with multiple layers for rendering a soft brushstroke |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171013 |
|
RJ01 | Rejection of invention patent application after publication |