CN108228178A - A kind of page to APP carries out the method and apparatus for changing skin - Google Patents

A kind of page to APP carries out the method and apparatus for changing skin Download PDF

Info

Publication number
CN108228178A
CN108228178A CN201711354176.7A CN201711354176A CN108228178A CN 108228178 A CN108228178 A CN 108228178A CN 201711354176 A CN201711354176 A CN 201711354176A CN 108228178 A CN108228178 A CN 108228178A
Authority
CN
China
Prior art keywords
page
key
skin
business
character string
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711354176.7A
Other languages
Chinese (zh)
Inventor
苏爱翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201711354176.7A priority Critical patent/CN108228178A/en
Publication of CN108228178A publication Critical patent/CN108228178A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction 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

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)
  • Software Systems (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

A kind of element on page to APP carries out initialization display and the method and apparatus for changing skin.The method for wherein carrying out changing skin to the element on the page of APP includes the following steps:Instruction input by user is received, 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 where described instruction from the page provides;The new theme colour of skin character string file is obtained by the acquisition approach of the new theme colour of skin character string file, wherein by the pre-recorded acquisition approach of business;The value of key is obtained from the new theme colour of skin character string file according to the key corresponding to the element, wherein by the pre-recorded key of business;And assignment is carried out to the element with the value of the key by corresponding to the assignment method of the key, the element is shown to refresh, wherein by the pre-recorded assignment method of business.By the scheme of embodiment, the maintainability and performance of business can be improved.

Description

A kind of page to APP carries out the method and apparatus for changing skin
Technical field
The present invention relates to APP to change skin field, more specifically, be related to a kind of page to APP change skin method and Device.
Background technology
With the development of Internet technology, the terminal devices such as mobile phone or tablet computer have become in people's daily life not The equipment that can or lack.Application developers alleviate aestheticly tired of the user for application, one after another to increase the customizability of application The function of changing skin is added in the application.Therefore, it is necessary to a kind of page to APP effectively change the scheme of skin.
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.
Description of the drawings
This specification embodiment is described in conjunction with the accompanying drawings, can so that this specification embodiment is clearer:
Fig. 1 shows the method that the element on the page to APP of this specification one embodiment carries out initialization display;
Fig. 2 shows the elements on the page to APP according to this specification one embodiment to carry out initialization display Method;
Fig. 3 shows that the element on the page to APP of this specification one embodiment carries out the device of initialization display 300;
Fig. 4 shows that the element on the page to APP of this specification one embodiment carries out the device of initialization display 400;
Fig. 5 shows that the element on the page to APP according to this specification one embodiment carries out the method for changing skin;
Fig. 6 shows that the element on the page to APP according to this specification one embodiment carries out the method for changing skin;
Fig. 7 shows the schematic diagram that multiple view examples recursive traversals change with skin;
Fig. 8 shows that the element on the page to APP according to this specification one embodiment change the device of skin 800;And
Fig. 9 shows that the element on the page to APP according to this specification one embodiment change the device 900 of skin.
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.

Claims (18)

1. the method that the element on a kind of page to APP carries out initialization display, including:
The Default Subject colour of skin character string is obtained by the acquisition approach of the Default Subject colour of skin character string file of the page File, wherein being passed to the acquisition approach as the business where the page;
The value of key is obtained from the Default Subject colour of skin character string file according to the key corresponding to the element, wherein by described Business is passed to the key;And
Assignment is carried out to the element with the value of the key by corresponding to the assignment method of the key, to show the member Element, wherein being passed to the assignment method by the business.
2. the method that the element on the page according to claim 1 to APP carries out initialization display, further includes, logical The assignment method crossed corresponding to the key carries out assignment with the value of the key to the element, after showing the element, The acquisition approach, the key and the assignment method are recorded, for changing skin to the element.
3. the method that the element on a kind of page to APP carries out initialization display, including:
The Default Subject colour of skin character string is obtained by the acquisition approach of the Default Subject colour of skin character string file of the page File, wherein being previously written the acquisition approach as the business where the page;
The value of key is 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 is carried out to the element with the value of the key according to the assignment method corresponding to the key, to show the member Element, wherein being previously written the assignment method by the business.
4. the element on the page according to any one of claim 1-3 to APP carries out the method for initialization display, institute The method of stating is the method for access type.
5. the element on the page according to any one of claim 1-3 to APP carries out the method for initialization display, institute Method is stated to be located in a classification of UIView.
6. the method that the element on the page according to any one of claim 1-3 to APP carries out initialization display, Described in key for background colour, background picture, text color, text size, text height, font size, word Body thickness, Button Color, button press color, dimension of picture, picture distance values or Pictures location.
7. the method that the element on the page according to any one of claim 1-3 to APP carries out initialization display, Described in the page be the pages of one or more business that include of the APP.
8. the element on a kind of page to APP carries out the method for changing skin, including:
Instruction input by user is received, in multiple theme colour of skin character string files that the business where described instruction from the page provides Select the new theme colour of skin character string file of the page;
The new theme colour of skin character string file is obtained by the acquisition approach of the new theme colour of skin character string file, wherein by The pre-recorded acquisition approach of business;
The value of key is obtained from the new theme colour of skin character string file according to the key corresponding to the element, wherein by the industry Be engaged in the pre-recorded key;And
Assignment is carried out to the element with the value of the key by corresponding to the assignment method of the key, to refresh described in display Element, wherein by the pre-recorded assignment method of the business.
9. the element on the page according to claim 8 to APP carries out the method for changing skin, further include, passing through correspondence Assignment is carried out to the element with the value of the key in the assignment method of the key, after refreshing the display element, note The acquisition approach, the key and the assignment method are recorded, the element is carried out for again to change skin.
10. the element on a kind of page to APP carries out the method for changing skin, including:
Instruction input by user is received, in multiple theme colour of skin character string files that the business where described instruction from the page provides Select the new theme colour of skin character string file of the page;
The new theme colour of skin character string file is obtained by the acquisition approach of the new theme colour of skin character string file of the page, The acquisition approach is wherein previously written by the business;
The value of key is obtained from the new theme colour of skin character string file according to the key corresponding to the element, wherein by the industry Business is previously written the key;And
Assignment is carried out to the element with the value of the key according to the assignment method corresponding to the key, to refresh described in display Element, wherein being previously written the assignment method by the business.
11. the element on the page to APP according to any one of claim 8-10 carries out the method for changing skin, the side Method is the method for access type.
12. the element on the page to APP according to any one of claim 8-10 carries out the method for changing skin, the side Tagmeme is in a classification of UIView.
13. the element on the page to APP according to any one of claim 8-10 carries out the method for changing skin, wherein institute It is thick for background colour, background picture, text color, text size, text height, font size, font to state key Carefully, Button Color, button press color, dimension of picture, picture distance values or Pictures location.
14. the element on the page to APP according to any one of claim 8-10 carries out the method for changing skin, also wrap It includes, the method is carried out to the view recursive traversals included by the page.
15. the element on the page to APP according to any one of claim 8-10 carries out the method for changing skin, wherein institute The page is stated as the page in window current page or stack.
16. the element on the page to APP according to any one of claim 8-10 carries out the method for changing skin, wherein institute It is the page of one or more business that the APP includes to state the page.
17. the element on the page to APP according to any one of claim 8-10 carries out the method for changing skin, wherein connecing Instruction input by user is received, institute is selected in multiple theme colour of skin character string files that the business where described instruction from the page provides The new theme colour of skin character string file for stating the page includes, and the business provides the theme colour of skin of multiple theme colour of skin character string files Preview, for selection by the user.
18. a kind of computer-readable storage medium, is stored thereon with instruction code, described instruction code performs in a computer When, enable the method described in any one of computer perform claim requirement 1-17.
CN201711354176.7A 2017-12-15 2017-12-15 A kind of page to APP carries out the method and apparatus for changing skin Pending CN108228178A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711354176.7A CN108228178A (en) 2017-12-15 2017-12-15 A kind of page to APP carries out the method and apparatus for changing skin

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711354176.7A CN108228178A (en) 2017-12-15 2017-12-15 A kind of page to APP carries out the method and apparatus for changing skin

Publications (1)

Publication Number Publication Date
CN108228178A true CN108228178A (en) 2018-06-29

Family

ID=62649844

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711354176.7A Pending CN108228178A (en) 2017-12-15 2017-12-15 A kind of page to APP carries out the method and apparatus for changing skin

Country Status (1)

Country Link
CN (1) CN108228178A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109284165A (en) * 2018-10-30 2019-01-29 武汉斗鱼网络科技有限公司 Client skin change method, device, equipment and computer readable storage medium
CN109542434A (en) * 2018-10-25 2019-03-29 深圳点猫科技有限公司 A kind of the theme dynamic switching method and electronic equipment of language based on programming
CN109684026A (en) * 2019-01-14 2019-04-26 武汉斗鱼鱼乐网络科技有限公司 APP replacing skins method, apparatus, electronic equipment and storage medium
CN110908655A (en) * 2019-10-16 2020-03-24 浙江大搜车软件技术有限公司 Skin changing method, skin changing device, computer equipment and readable storage medium
CN111273894B (en) * 2020-02-25 2023-06-09 政采云有限公司 Page skin changing method, device, equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1997034388A2 (en) * 1996-03-12 1997-09-18 Compuserve Incorporated System for developing user interface themes
CN104050002A (en) * 2014-06-24 2014-09-17 广州金山网络科技有限公司 Skin changing method and device for application software interface
CN104252341A (en) * 2013-06-26 2014-12-31 腾讯科技(深圳)有限公司 Method and device for resurfacing application program and client side device of application program
CN107357611A (en) * 2017-06-27 2017-11-17 上海传英信息技术有限公司 The theme update method and device of user interface

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1997034388A2 (en) * 1996-03-12 1997-09-18 Compuserve Incorporated System for developing user interface themes
CN104252341A (en) * 2013-06-26 2014-12-31 腾讯科技(深圳)有限公司 Method and device for resurfacing application program and client side device of application program
CN104050002A (en) * 2014-06-24 2014-09-17 广州金山网络科技有限公司 Skin changing method and device for application software interface
CN107357611A (en) * 2017-06-27 2017-11-17 上海传英信息技术有限公司 The theme update method and device of user interface

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
贝壳的世界: "iOS换肤方案", 《HTTPS://WWW.JIANSHU.COM/P/54A1F56F5249》 *
黄建内等: "给你的IE浏览器换肤技巧", 《电脑使用小窍门1000例》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542434A (en) * 2018-10-25 2019-03-29 深圳点猫科技有限公司 A kind of the theme dynamic switching method and electronic equipment of language based on programming
CN109284165A (en) * 2018-10-30 2019-01-29 武汉斗鱼网络科技有限公司 Client skin change method, device, equipment and computer readable storage medium
CN109284165B (en) * 2018-10-30 2021-11-09 武汉斗鱼网络科技有限公司 Client skin changing method, device, equipment and computer readable storage medium
CN109684026A (en) * 2019-01-14 2019-04-26 武汉斗鱼鱼乐网络科技有限公司 APP replacing skins method, apparatus, electronic equipment and storage medium
CN109684026B (en) * 2019-01-14 2022-02-22 武汉斗鱼鱼乐网络科技有限公司 APP skin replacement method and device, electronic equipment and storage medium
CN110908655A (en) * 2019-10-16 2020-03-24 浙江大搜车软件技术有限公司 Skin changing method, skin changing device, computer equipment and readable storage medium
CN110908655B (en) * 2019-10-16 2023-12-05 浙江大搜车软件技术有限公司 Skin changing method, device, computer equipment and readable storage medium
CN111273894B (en) * 2020-02-25 2023-06-09 政采云有限公司 Page skin changing method, device, equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN108228178A (en) A kind of page to APP carries out the method and apparatus for changing skin
CN110457994B (en) Face image generation method and device, storage medium and computer equipment
CN109729420A (en) Image processing method and device, mobile terminal and computer readable storage medium
CN109978972A (en) A kind of method and device of copy editor in picture
CN104917666A (en) Method of making personalized dynamic expression and device
CN107807821A (en) The implementation method and terminal of animation pop-up
TW201237764A (en) Method, apparatus, and computer program product for overlapped handwriting
CN106648666A (en) User interface generating method and user interface generating system
CN110244985A (en) A kind of view rendering method, computer storage medium and terminal device
CN106354355A (en) User interface layout method, device and system
CN108038892A (en) Expression, which packs, makees method, apparatus, electronic equipment and computer-readable recording medium
CN107469350A (en) A kind of Card Games control method and device
CN106408623A (en) Character presentation method, device and terminal
CN110213458A (en) A kind of image processing method, device and storage medium
CN104657668A (en) Terminal
CN109615671A (en) A kind of character library sample automatic generation method, computer installation and readable storage medium storing program for executing
CN107220067A (en) The loading method and device of scalable vector graphicses picture under Android system
CN104793937B (en) A kind of startup control method and device
CN106681735A (en) Method, device and apparatus for generating dynamic icons based fonts
CN108268499A (en) A kind of Webpage display process and device
CN106372158A (en) Method and device for processing user behavior data
CN106293658A (en) A kind of interface assembly generates method and equipment thereof
CN106502648A (en) Application shows the method and terminal of language-specific
CN108986187A (en) A kind of implementation method, device, storage medium and the android terminal of general animation
CN104657991A (en) Picture processing method

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1255662

Country of ref document: HK

TA01 Transfer of patent application right

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20180629

RJ01 Rejection of invention patent application after publication