Invention content
This specification embodiment is intended to provide a kind of more effective skin change method, to solve deficiency of the prior art.
To achieve the above object, it is aobvious that the element that on the one hand this specification is provided on a kind of page to APP carries out initialization
The method shown, including:The Default Subject is obtained by the acquisition approach of the Default Subject colour of skin character string file of the page
Colour of skin character string file, wherein being passed to the acquisition approach as the business where the page;According to corresponding to the element
Key obtains the value of key from the Default Subject colour of skin character string file, wherein being passed to the key by the business;And pass through
Assignment is carried out to the element with the value of the key corresponding to the assignment method of the key, to show the element, wherein by
The business is passed to the assignment method.
In one embodiment, the method that the element on the above-mentioned page to APP carries out initialization display further includes, logical
It crosses the assignment method corresponding to the key that the business is passed to and assignment is carried out to show to the element with the value of the key
After the element, the acquisition approach, the key and the assignment method are recorded, for changing skin to the element.
The method that a kind of on the other hand element that this specification is provided on page to APP carries out initialization display includes:
The Default Subject colour of skin character string file is obtained by the acquisition approach of the Default Subject colour of skin character string file of the page,
The acquisition approach is wherein previously written as the business where the page;It is write from memory according to the key corresponding to the element from described
The value that theme colour of skin character string file obtains key is recognized, wherein being previously written the key by the business;And according to corresponding to
The assignment method of the key carries out assignment with the value of the key to the element, to show the element, wherein by the industry
Business is previously written the assignment method.
In one embodiment, the method that the element on the above-mentioned page to APP carries out initialization display is access type
Method.
In one embodiment, the method that the element on the above-mentioned page to APP carries out initialization display is located at UIView
A classification in.
In one embodiment, the element on the above-mentioned page to APP is carried out in the method for initialization display, described
Key is background colour, background picture, text color, text size, text height, font size, font are thick
Carefully, Button Color, button press color, dimension of picture, picture distance values or Pictures location.
In one embodiment, the element on the above-mentioned page to APP is carried out in the method for initialization display, the page
Face is the page of one or more business that the APP includes.
Element on a kind of page to APP of this specification another aspect carries out the device of initialization display, including:It obtains
Unit is configured to, and the Default Subject skin is obtained by the acquisition approach of the Default Subject colour of skin character string file of the page
Color character string file, wherein being passed to the acquisition approach as the business where the page;It is worth obtaining unit, is configured to, according to
The value of key is obtained from the Default Subject colour of skin character string file corresponding to the key of the element, wherein being passed to by the business
The key;And assignment unit, it is configured to, by corresponding to the assignment method of the key with the value of the key to the member
Element carries out assignment, to show the element, wherein being passed to the assignment method by the business.
In one embodiment, the element on the above-mentioned page to APP carry out initialization display device further include record
Unit is configured to, in the assignment method corresponding to the key being passed to by the business with the value of the key to the member
After element carries out assignment to show the element, the acquisition approach, the key and the assignment method are recorded, for
Skin is changed to the element.
A kind of on the other hand element that this specification is provided on page to APP carries out the device of initialization display, including:
Acquiring unit is configured to, and obtaining the acquiescence by the acquisition approach of the Default Subject colour of skin character string file of the page leads
Colour of skin character string file is inscribed, wherein being previously written the acquisition approach as the business where the page;It is worth obtaining unit, configuration
The value of key to be obtained from the Default Subject colour of skin character string file according to the key corresponding to the element, wherein by described
Business is previously written the key;And assignment unit, it is configured to, according to the assignment method corresponding to the key with the key
Value to the element carry out assignment, to show the element, wherein the business is previously written the assignment method.
A kind of on the other hand element that this specification is provided on page to APP carries out the method for changing skin, including:It receives and uses
The instruction of family input selectes the page in multiple theme colour of skin character string files that business where described instruction from the page provides
The new theme colour of skin character string file in face;The new theme is obtained by the acquisition approach of the new theme colour of skin character string file
Colour of skin character string file, wherein by the pre-recorded acquisition approach of the business;According to the key corresponding to the element from institute
The value that new theme colour of skin character string file obtains key is stated, wherein by the pre-recorded key of the business;And pass through correspondence
Assignment is carried out to the element with the value of the key in the assignment method of the key, the element is shown to refresh, wherein by
The pre-recorded assignment method of business.
In one embodiment, the method that the element on the above-mentioned page to APP carries out changing skin further includes, by described
The assignment method corresponding to the key of business record carries out assignment to refresh display institute with the value of the key to the element
After stating element, the acquisition approach, the key and the assignment method are recorded, for being carried out again to the element
Change skin.
A kind of on the other hand element that this specification is provided on page to APP carries out the method for changing skin, including:It receives and uses
The instruction of family input selectes the page in multiple theme colour of skin character string files that business where described instruction from the page provides
The new theme colour of skin character string file in face;By described in the acquisition approach acquisition of the new theme colour of skin character string file of the page
New theme colour of skin character string file, wherein being previously written the acquisition approach by the business;According to corresponding to the element
Key obtains the value of key from the new theme colour of skin character string file, wherein being previously written the key by the business;And root
Assignment is carried out to the element with the value of the key according to the assignment method corresponding to the key, the element is shown to refresh,
The assignment method is wherein previously written by the business.
In one embodiment, the method that the element on the above-mentioned page to APP carries out changing skin is the method for access type.
In one embodiment, the method that the element on the above-mentioned page to APP carries out changing skin is located at one of UIView
In classification.
In one embodiment, the element on the above-mentioned page to APP change in the method for skin, and the key is the back of the body
Scenery, background picture, text color, text size, text height, font size, font weight, button face
Color, button press color, dimension of picture, picture distance values or Pictures location.
In one embodiment, the method that the element on the above-mentioned page to APP carries out changing skin further includes, to the page
Carry out the method to included view recursive traversals.
In one embodiment, the element on the above-mentioned page to APP change in the method for skin, and the page is window
The page in mouth current page or stack.
In one embodiment, the element on the above-mentioned page to APP change in the method for skin, and the page is institute
State the page of one or more business that APP includes.
In one embodiment, the element on the above-mentioned page to APP change in the method for skin, receives user's input
Instruction, select the new of the page in multiple theme colour of skin character string files that business where described instruction from the page provides
Theme colour of skin character string file includes, and the business provides the theme colour of skin preview of multiple theme colour of skin character string files, for
User selects.
A kind of on the other hand element that this specification is provided on page to APP change the device of skin, including:It receives single
Member is configured to, and receives instruction input by user, multiple theme colour of skin character strings that the business where described instruction from the page provides
The new theme colour of skin character string file of the page is selected in file;Acquiring unit is configured to, and passes through the new theme colour of skin word
The acquisition approach for according with string file obtains the new theme colour of skin character string file, wherein by the pre-recorded acquisition of the business
Path;It is worth obtaining unit, is configured to, is obtained according to the key corresponding to the element from the new theme colour of skin character string file
The value of key, wherein by the pre-recorded key of the business;And assignment unit, it is configured to, by corresponding to the key's
Assignment method carries out assignment with the value of the key to the element, the element is shown to refresh, wherein advance by the business
Record the assignment method.
In one embodiment, the element on the above-mentioned page to APP change the device of skin and further includes recording unit, matches
It is set to, the element is assigned with the value of the key by the assignment method corresponding to the key that the business is passed to
After value is to refresh the display element, the acquisition approach, the key and the assignment method are recorded, for again
The element is carried out to change skin.
A kind of on the other hand element that this specification is provided on page to APP change the device of skin, including:It receives single
Member is configured to, and receives instruction input by user, multiple theme colour of skin character strings that the business where described instruction from the page provides
The new theme colour of skin character string file of the page is selected in file;Acquiring unit is configured to, and passes through the new theme of the page
The acquisition approach of colour of skin character string file obtains the new theme colour of skin character string file, wherein being previously written institute by the business
State acquisition approach;It is worth obtaining unit, is configured to, according to the key corresponding to the element from the new theme colour of skin character illustration and text juxtaposed setting
Part obtains the value of key, wherein being previously written the key by the business;And assignment unit, it is configured to, according to corresponding to institute
It states the assignment method of key and assignment is carried out to the element with the value of the key, the element is shown to refresh, wherein by described
Business is previously written the assignment method.
On the other hand this specification provides a kind of computer-readable storage medium, be stored thereon with instruction code, described
When instruction code performs in a computer, enable described in the requirement of computer perform claim any one of 1-7 and claim 15-24
Method.
The present invention changes skin flush logic with a kind of general technology solution to be uniformly processed, and avoids a large amount of repetition logics
And code.When skin is changed in user's triggering, business need not perceive and part perceives, and business does not need to any flush logic, and theme
Brush again logic only just performed when changing skin triggering, performance height.
Specific embodiment
This specification embodiment is intended to provide such initialization and shows the page or to the page change the method that skin is shown
And device, wherein calling the interface method in the classification (category) at UIView interface layers, the interface when showing the page
Method automatically or semi-automatically can carry out changing skin to each View examples recursive traversal on the page, so as to eliminate in page
The a large amount of maintainabilitys for repeating logics and code, improving APP for being used to show or change skin at each View examples in face, and
And during showing or changing skin, business improves performance without participation or subparticipation.
The specific embodiment of this specification is described below in conjunction with the accompanying drawings.
Fig. 1 shows the method that the element on the page to APP of this specification one embodiment carries out initialization display.
Method shown in FIG. 1 is the method for access type, that is, it is located in a classification of UIView.Here, the initialization of the page is shown
Show and refer to, the process shown is initially opened to the page, that is, the page is not current display page nor was once beaten
It opens and is located at the page in stack.Here APP can be the arbitrary application software in any intelligent subscriber equipment, and the intelligence is used
Family equipment is, for example, mobile phone, palm PC, tablet computer or wearing such as smartwatch, Intelligent bracelet or intelligent jewellery
Wear smart machine etc..
Below in the detailed description of this specification embodiment, using ios development languages (i.e. ObjC) to the reality of step
It applies and is illustrated, it should be appreciated that the method in this specification embodiment can be applied to all language and hardware rather than only
It is only limitted to ObjC and iphone.
Business needs to be passed to four parameters when calling method shown in FIG. 1:SelectorStr (assignment method), key,
Bundle (theme acquisition approach) and defaultvalue, so as to which this method can be automatically performed assignment and the display to the page,
And business is unaware is not involved in.
The step of this method is detailed below.
In step S11, the acquiescence is obtained by the acquisition approach of the Default Subject colour of skin character string file of the page
Theme colour of skin character string file (such as theme1.strings), wherein being passed to the acquisition road as the business where the page
Diameter.Specifically, theme colour of skin character string file is the character string file for representing corresponding theme colour of skin resource, including the page
It is middle need to the corresponding key (key) of element to be shown and key value (value).Specifically, each key can include background colour, the back of the body
Scape picture, text color, text size, text height, font size, font weight, Button Color, button
Press color, dimension of picture, picture distance values and Pictures location etc..
The business (such as Yuebao business) that APP (such as Alipay APP) includes is in the framework.bundle of oneself
It is middle to establish personalized more set subject resources, such as (theme1.strings, theme2.strings ...).New page will opened
When, the business where the page first initializes the page, set the page it is bundle corresponding (such as
Bundle1) and wherein the subject (such as theme1.strings) of theme, the theme correspond to the page fault theme, with
And bundle1 correspond to for obtain page fault theme path (to the framework.bundle absolute path or
Relative path).Business is by the subject (theme1.strings) and bundle (bundle1) to the Subject Manager of APP
Device (thememanager) is registered, so as to which the business where the page can find the acquiescence master of the page by theme manager
Inscribe colour of skin character string file.
When calling interface method shown in FIG. 1, business to the interface method be passed to parameter bundle (such as
Bundle1), i.e., the interface method obtains the path for obtaining Default Subject colour of skin character string file, so as to remove theme pipe
Reason device finds Default Subject colour of skin character string file.Specifically, in the interface method call method _ theme (bundle,
Key, defaultValue), to the bundle names of the theme manager offer page, so as to find Default Subject character string file
(theme1.string)。
In the theme colour of skin of business where the unselected new open page face of user, above-mentioned Default Subject colour of skin character illustration and text juxtaposed setting
Part is the theme colour of skin character string file of system default.And user triggered business change skin and select the new open page face
During the theme colour of skin of place business, above-mentioned Default Subject colour of skin character string file is then the theme colour of skin character illustration and text juxtaposed setting that user selectes
Part.
In step S12, key is obtained from the Default Subject colour of skin character string file according to the key corresponding to the element
Value, wherein being passed to the key by the business.Specifically, call method _ theme (bundle, key,
DefaultValue), after Default Subject character string file (theme1.string) is found, by being passed to by the business
Key the value (Value) of key is obtained from Default Subject colour of skin character string file.
Then, in step S13, the element is carried out with the value of the key by corresponding to the assignment method of the key
Assignment, to show the element, wherein being passed to the assignment method by the business.Specifically, to each view of page realities
Example object reference performSelector, hence for each element that each view examples include, is passed to business and corresponded to
The element progress assignment corresponding to key that the assignment method of the key includes each view examples with the value of key, and according to
The assignment renders each view, so as to which display includes the complete page of each view examples on window.
Wherein, each view examples can include multiple need elements to be shown, such as BackgroundColor (backgrounds
Color), Font (font), Size (font size), Image (image) etc..The corresponding key of above-mentioned element is for example respectively
MAIN_BTN_STYLE5_BACKGROUND_COLOR_NORMAL, TOAST_MSG_FONT, TOAST_ICON_SIZE and
SEARCHBAR_SEARCH_ICON_IMAGE_PATH, corresponding assignment method are for example respectively:setBackgroundColor、
SetFont, setSize and setImage.By calling above-mentioned interface method to each view examples, and successively to each successively
Each display elements in view examples carry out assignment, so as to initialize the display page.
In one embodiment, the method that the element on the above-mentioned page to APP carries out initialization display further includes step
S14 is carrying out assignment, to show the member with the value of the key by corresponding to the assignment method of the key to the element
After element, the acquisition approach, the key and the assignment method are recorded, for changing skin to the element.Specifically
Ground for each view object instances, can record selectorstr, key, bundle and defaultvalue (optional).When
Business receive change skin triggering when, the bundle that business can record from here finds new theme2.string, passes through record
Key finds the value of key, and the assignment method (selectorstr) corresponding to key of usage record from theme2.string
Assignment is carried out to each element on the page to change skin, so as to change full page skin, is herein below carried out exchange skin process
Detailed description.
In the method for carrying out initialization display to the page of APP in this embodiment, pass through the general of calling interface method
Technical solution is uniformly processed display logic, and business need to be only the key and value of the corresponding colour of skin of each view examples setting, keep away
A large amount of repetition logics and code are exempted from.Also, theme shows process business unaware, improves performance.
Fig. 2 shows the elements on the page to APP according to this specification one embodiment to carry out initialization display
Method.This method is also a kind of interface method, and statement is in a classification of UIView.It is different from method shown in FIG. 1
, the inside of the write-in interface method is real in the designation method of the page (UIViewController classifications) in advance for business
It is existing, including the element, corresponding key, bundle and assignment method for needing to change skin.When showing new page, the interface
Method judges current ViewController/UIView object instances either with or without realizing this method, that is, either with or without writing in advance
Enter the inside implementation method of the interface method, one time is carried out if having so as to achieve the purpose that render Default Subject.
The step of method shown in Fig. 2 being illustrated below with reference to Fig. 2.As shown in Fig. 2, in step S21, pass through the page
The acquisition approach of Default Subject colour of skin character string file obtain the Default Subject colour of skin character string file, wherein by the page
Business where face is previously written the acquisition approach.It is similar with the step S11 in Fig. 1, the acquiescence being previously written by business
The acquisition approach (such as bundle1) of theme colour of skin character string file finds Default Subject colour of skin character illustration and text juxtaposed setting from theme manager
Part.Specifically, call method _ theme (bundle, key, defaultValue) provides bundle (examples to theme manager
Such as bundle1), so as to find Default Subject character string file (theme1.string),
In step S22, key is obtained from the Default Subject colour of skin character string file according to the key corresponding to the element
Value, wherein being previously written the key by the business.Specifically, call method _ theme (bundle, key,
DefaultValue), after Default Subject character string file (theme1.string) is found, it is previously written by business
Key obtains the value of key from the Default Subject colour of skin character string file.
In step S23, assignment is carried out to the element with the value of the key according to the assignment method corresponding to the key,
To show the element, wherein the business is previously written the assignment method.Specifically, it for each view examples, calls
The assignment method that above-mentioned business is previously written carries out each element assignment, and carries out wash with watercolours to each element according to the assignment
Dye, so as to which display includes the complete page of each view examples on window.
Wherein, each view examples can include multiple display elements, for example, backgroundColor,
SeparatorColor, BackgroundImage, corresponding key be, for example, TABLEVIEW_BACKGROUND_COLOR,
TABLEVIEW_SEPARATOR_COLOR and NAVIGATIONBAR_LEFT_BAR_BUTTON_IMA, corresponding assignment method example
Such as it is respectively self.mainTableview.backgroundColor, self.mainTableview.backgroundColor
With self.navigationItem.leftBarButtonItem setBackgroundImage, assignment method here is to be
System method.
In the page to APP of the embodiment carries out the method for initialization display, pass through the general of calling interface method
Page display logic is uniformly processed in technical solution, and the inside of interface method need to be only written in business in page designation method
It realizes, avoids a large amount of repetition logics and code.Also, the page shows process business unaware, improves performance.
The method that the above-mentioned page to APP carries out initialization display can carry out the page of one or more business initial
Change display, carry out initialization including the page to entire APP and show.
Fig. 3 shows that the element on the page to APP of this specification one embodiment carries out the device of initialization display
300.As shown in the figure, device 300 includes:Acquiring unit 31, is configured to, the page being passed to by the business where the page
The acquisition approach of the Default Subject colour of skin character string file in face obtains the Default Subject colour of skin character string file;It is worth obtaining unit
32, it is configured to, is obtained according to the key corresponding to the element that the business is passed to from the Default Subject colour of skin character string file
Obtain the value of key;And assignment unit 33, it is configured to, the assignment method corresponding to the key being passed to by the business is with institute
The value for stating key carries out assignment to show the element to the element.In one embodiment, described device 300 further includes note
Unit 34 is recorded, is configured to, in the assignment method corresponding to the key being passed to by the business with the value of the key to institute
After element progress assignment is stated to show the element, the acquisition approach, the key and the assignment method are recorded, with
For changing skin to the element.
Fig. 4 shows that the element on the page to APP of this specification one embodiment carries out the device of initialization display
400.As shown in the figure, device 400 includes:Acquiring unit 41, is configured to, the institute being previously written by the business where the page
The acquisition approach for stating the Default Subject colour of skin character string file of the page obtains the Default Subject colour of skin character string file;Value obtains
Unit 42, is configured to, according to the key corresponding to the element that the business is previously written from the Default Subject colour of skin character
String file obtains the value of key;And assignment unit 43, it is configured to, the assignment method being previously written according to the business is with key's
Value carries out assignment to show the element to the element.
Fig. 5 shows that the element on the page to APP according to this specification one embodiment carries out the method for changing skin.With
Method is similar shown in Fig. 1, and method shown in fig. 5 is also the method for access type, that is, and it is located in a classification of UIView,
Method name is all au_bindTheme.Here, the page is the page for having already passed through initialization display, that is, the page is to work as
The preceding display page is once opened and the page in the stack.Here APP can be in any intelligent subscriber equipment
Arbitrary application software, the intelligent subscriber equipment are, for example, mobile phone, palm PC, tablet computer or such as smartwatch, intelligence
Wearable smart machine of bracelet or intelligent jewellery etc..
Method shown in fig. 5 includes the following steps.In step S51, instruction input by user is received, described instruction is from the page
The new theme colour of skin character string file of the page is selected in multiple theme colour of skin character string files that the business at place provides.With
The instruction of family input is the instruction that skin is changed in triggering, and in the new colour of skin of the selection page, business can provide multiple theme colour of skin words
The theme colour of skin preview of string file is accorded with, for selection by the user.User select the theme colour of skin (such as theme2.strings) it
Afterwards, business by the selected theme2.strings replace in the bundle1 of the page Default Subject (such as
Theme1.stings it), and to theme manager registers, so as to business, can to find this by theme manager selected
theme2.strings。
In step S52, the new theme colour of skin word is obtained by the acquisition approach of the new theme colour of skin character string file
String file is accorded with, wherein by the pre-recorded acquisition approach of the business.Specifically, call method _ theme (bundle, key,
Value), to theme manager provide business it is pre-recorded established when initializing the page the bundle of page names (such as
Bundle1), so as to find new theme character string file (theme2.string).In step S53, according to corresponding to the element
Key the value of key is obtained from the new theme colour of skin character string file, wherein by the pre-recorded key of the business.Specifically
It is call method _ theme (bundle, key, Value), after theme character string file (theme2.string) is found,
The value (Value) of key is obtained from theme2.string by the pre-recorded key of business.Then, in step S54, by right
The assignment method of key described in Ying Yu carries out assignment with the value of the key to the element, and the element is shown to refresh, wherein
By the pre-recorded assignment method of the business.Specifically, each view instance objects of the page are called
PerformSelector, by the pre-recorded assignment method corresponding to key of business with the value of key to each of the page
The element corresponding to key that view examples include carries out assignment, and re-start rendering to each element according to the assignment, from
And refresh the complete page that display includes each view examples on window.
In one embodiment, the above-mentioned page to APP change the interface method called in the method for skin and further includes step
Rapid S55 is carrying out assignment, to refresh display with the value of the key by corresponding to the assignment method of the key to the element
After the element, record the acquisition approach, the key and the assignment method, for again to the element into
Row changes skin.Specifically, for each view object instances, selectorstr (the assignment sides corresponding to each element can be recorded
Method), key, bundle (acquisition approach) and defaultvalue (optional).When business receives again changes skin triggering, business
Bundle can be recorded from here and find new theme3.strings, and pass through record key and corresponding assignment method to page
Face carries out changing skin again.
In this embodiment the page of APP change in the method for skin, pass through the general technology solution of calling interface method
Certainly scheme changes skin flush logic to be uniformly processed, and business need to be only the key and value of the corresponding colour of skin of each view examples setting, avoid
It is a large amount of to repeat logics and codes.Also, theme handoff procedure business unaware, the logic business of stack top VC brush themes again are complete
It need not participate in, the logic of brush again of theme is only just performed when changing skin triggering, improves performance.
Fig. 6 shows that the element on the page to APP according to this specification one embodiment carries out the method for changing skin, should
Method is similar with method shown in Fig. 2 and a kind of interface method, i.e. its statement in a classification of UIView, and
The inside realization of the interface method, side is written in business in the designation method of the page (UIViewController classifications) in advance
Religious name is all au_updateThemeIfNeeded.Here, the page is the page for having already passed through initialization display, that is, should
The page is current display page or is once opened and the page in the stack.Here APP can be any intelligent subscriber
Arbitrary application software in equipment, the intelligent subscriber equipment are, for example, mobile phone, palm PC, tablet computer or such as intelligence
Wearable smart machine of wrist-watch, Intelligent bracelet or intelligent jewellery etc..
Method shown in fig. 6 includes the following steps.In step S61, instruction input by user is received, described instruction is from the page
The new theme colour of skin character string file of the page is selected in multiple theme colour of skin character string files that the business at place provides.With
The instruction of family input is the instruction that skin is changed in triggering, and in the new colour of skin of the selection page, business can provide multiple theme colour of skin words
The theme colour of skin preview of string file is accorded with, for selection by the user.User select the theme colour of skin (such as theme2.strings) it
Afterwards, business by the selected theme2.strings replace in the bundle1 of the page Default Subject (such as
Theme1.stings it), and to theme manager registers, so as to business, can to find this by theme manager selected
theme2.strings。
In step S62, the new theme is obtained by the acquisition approach of the new theme colour of skin character string file of the page
Colour of skin character string file, wherein being previously written the acquisition approach by the business.Specifically, call method _ theme
(bundle, key, Value), the bundle of the page names being written in designation method to theme manager offer business (such as
Bundle1), so as to find new theme character string file (theme2.string).In step S63, according to corresponding to the element
Key obtain the value of key from the new theme colour of skin character string file, wherein being previously written the key by the business.Specifically
It is call method _ theme (bundle, key, Value), after theme character string file (theme2.string) is found,
The value (Value) of key is obtained from theme2.string by the key that business is written in designation method.And in step S64,
Assignment is carried out to the element with the value of the key according to the assignment method corresponding to the key, the member is shown to refresh
Element, wherein being previously written the assignment method by the business.Specifically, to each view instance objects of the page, pass through industry
Pair that the assignment method corresponding to key for being engaged in being written in designation method includes each view examples of the page with the value of key
Assignment should be carried out, and rendering is re-started to each element according to the assignment in the element of key, it is aobvious so as to refresh on window
Show the complete page for including each view examples.
In this embodiment the page of APP change in the method for skin, pass through the general technology solution of calling interface method
Certainly scheme changes skin flush logic to be uniformly processed, business need to be only written in designation method inside realize, avoid a large amount of repetitions
Logic and code.Also, theme handoff procedure business unaware, the logic of brush again of theme are only just performed when changing skin triggering, are carried
High performance.
In the above-described embodiments, when carrying out refreshing display to change skin to the page to the page, the page is included more
Carry out assignment to a view examples recursive traversal.Fig. 7 shows the signal that multiple view examples recursive traversals change with skin
Figure.As shown in the figure, by taking the Yuebao business in Alipay as an example, including following multiple view, " remaining sum of page top
It is precious " it is father view and VC.view.It includes sub- view " list that can be rolled ", and sub- view " list that can be rolled " is again
Including sub- view " orange background view " and " optimization financing view " etc., and sub- view " orange background view " includes sub- view
" income view yesterday ", " specific amount of money view " etc..Recursive traversal successively, all view that can be found out included by the page are real
Example, so as to according to the sequence of view examples, be assigned with the value of each key to each display elements in each view examples
Value, so as to carry out changing skin to this page.
The method that the above-mentioned page to APP change skin can carry out changing skin to the page of one or more business, including
The page of entire APP is carried out changing skin.
Fig. 8 shows that the element on the page to APP according to this specification one embodiment change the device of skin
800.As shown in the figure, device 800 includes:Receiving unit 81, is configured to, and receives instruction input by user, and described instruction is from the page
The new theme colour of skin character string file of the page is selected in multiple theme colour of skin character string files that the business at place provides;It obtains
Unit 82 is taken, is configured to, by described in the acquisition approach acquisition of the new theme colour of skin character string file of the business record
New theme colour of skin character string file;It is worth obtaining unit 83, is configured to, the element is corresponded to according to the business record
Key obtains the value of key from the new theme colour of skin character string file;And assignment unit 84, it is configured to, is remembered by the business
The assignment method corresponding to the key of record carries out assignment to refresh the display element with the value of the key to the element.
In one embodiment, device 800 further includes recording unit 85, is configured to, described in corresponding to of being passed to by the business
After the assignment method of key carries out assignment to refresh the display element with the value of the key to the element, obtained described in record
Path, the key and the assignment method are taken, the element is carried out for again to change skin.
Fig. 9 shows that the element on the page to APP according to this specification one embodiment change the device 900 of skin.
As shown in the figure, device 900 includes:Receiving unit 91, is configured to, and receives instruction input by user, described instruction is where the page
Business provide multiple theme colour of skin character string files in select the page new theme colour of skin character string file;It obtains single
Member 92, is configured to, the new theme colour of skin character string file of the page being previously written by the business where the page
Acquisition approach obtains the new theme colour of skin character string file;It is worth obtaining unit 93, is configured to, is previously written according to the business
The key corresponding to the element value of key is obtained from the new theme colour of skin character string file;And assignment unit 94, match
It is set to, assignment is carried out with described in refreshing display to the element with the value of key according to the assignment method that the business is previously written
Element.
This specification embodiment further includes a kind of computer-readable storage medium, is stored thereon with instruction code, described
When instruction code performs in a computer, the element that computer is performed on the above-mentioned page to APP is enabled to carry out initialization display
Method and the method for the element on the page of APP change skin.
Those of ordinary skill in the art should further appreciate that, be described with reference to the embodiments described herein
Each exemplary unit and algorithm steps, can be realized with the combination of electronic hardware, computer software or the two, in order to clear
Illustrate to Chu the interchangeability of hardware and software, generally describe each exemplary group according to function in the above description
Into and step.These functions hold track with hardware or software mode actually, depending on technical solution specific application and set
Count constraints.Those of ordinary skill in the art can be described to be realized using distinct methods to each specific application
Function, but this realization is it is not considered that beyond scope of the present application.
Track can be held with reference to the step of method or algorithm that the embodiments described herein describes with hardware, processor
Software module or the combination of the two implement.Software module can be placed in random access memory (RAM), memory, read-only storage
Device (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology neck
In any other form of storage medium well known in domain.
Above-described specific embodiment has carried out the purpose of the present invention, technical solution and advantageous effect further
It is described in detail, it should be understood that the foregoing is merely the specific embodiment of the present invention, is not intended to limit the present invention
Protection domain, all within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done should all include
Within protection scope of the present invention.