CN104866287B - Method and device for generating function bar - Google Patents

Method and device for generating function bar Download PDF

Info

Publication number
CN104866287B
CN104866287B CN201410057497.0A CN201410057497A CN104866287B CN 104866287 B CN104866287 B CN 104866287B CN 201410057497 A CN201410057497 A CN 201410057497A CN 104866287 B CN104866287 B CN 104866287B
Authority
CN
China
Prior art keywords
key
background
function bar
image
generating
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.)
Active
Application number
CN201410057497.0A
Other languages
Chinese (zh)
Other versions
CN104866287A (en
Inventor
罗琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410057497.0A priority Critical patent/CN104866287B/en
Publication of CN104866287A publication Critical patent/CN104866287A/en
Application granted granted Critical
Publication of CN104866287B publication Critical patent/CN104866287B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a device for generating a function bar, and belongs to the technical field of computers. The method comprises the following steps: calling a function bar background interface provided by a system program to generate a monochromatic function bar background image; acquiring a flattened key image, and generating a key code according to the flattened key image and a preset function code; and calling a function bar key interface provided by a system program, inputting the key code, and generating a function bar key on the upper layer of the function bar background image. By adopting the invention, the occupation of the application program on the storage resource can be reduced.

Description

Method and device for generating function bar
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for generating a function bar.
Background
With the rapid development of terminal technology, terminal devices such as mobile phones and tablet computers are widely popularized and applied, and application programs developed for the terminal devices are more and more abundant in types and more huge in quantity. Function bars are generally arranged in the application program, such as a navigation bar at the top of an application program interface, a tool bar at the bottom, and the like. The navigation bar is an application function bar at the top of the application interface below the system status bar. The toolbar is a function bar at the bottom of the application interface. In the system program of the terminal device, the basic style of the function bar is provided for all the application programs.
With the release of iOS7 (the name of the 7 th generation operating system developed by apple inc.), a flattened display style has started to prevail. Many applications also employ a flattened display style in iOS6 (the name of the 6 th generation operating system developed by apple) and earlier versions of the system. The corresponding processing mode is that the function bar provided by the system program is closed, the code of the user-defined function bar is added into the application program, and the function bar is displayed through the code.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
the function bar is generated by adopting the method, codes of the function bar are required to be completely written and added into codes of the application program, and many characteristics of the function bar need to be written into the codes, such as various animation effects of the function bar and the like. Thus, the application program code is huge and occupies too much storage resources.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for generating a function bar, so as to reduce occupation of storage resources by an application program. The technical scheme is as follows:
in one aspect, a method for generating a function bar is provided, and the method includes:
calling a function bar background interface provided by a system program to generate a monochromatic function bar background image;
acquiring a flattened key image, and generating a key code according to the flattened key image and a preset function code;
and calling a function bar key interface provided by a system program, inputting the key code, and generating a function bar key on the upper layer of the function bar background image.
In another aspect, an apparatus for generating a function bar is provided, the apparatus including:
the first generation module is used for calling a function bar background interface provided by a system program and generating a monochromatic function bar background image;
the acquisition module is used for acquiring a flattened key image and generating a key code according to the flattened key image and a preset function code;
and the second generation module is used for calling a function bar key interface provided by a system program, inputting the key code and generating a function bar key on the upper layer of the function bar background image.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, the function bar background interface provided by the system program is called to generate the monochromatic function bar background image, the flattened key image is obtained, the key code is generated according to the flattened key image and the preset function code, the function bar key interface provided by the system program is called to input the key code, and the function bar key is generated on the upper layer of the function bar background image, so that the function bar can be generated without adding the self-defined complete code of the function bar into the application program, and the occupation of the application program on the storage resource can be reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart of a method for generating a function bar according to an embodiment of the present invention;
FIGS. 2a, 2b, 3a, and 3b are schematic diagrams of function bars provided by embodiments of the present invention;
FIG. 4 is a schematic structural diagram of an apparatus for generating a function bar according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Example one
An embodiment of the present invention provides a method for generating a function bar, as shown in fig. 1, a processing flow of the method may include the following steps:
step 101, calling a function bar background interface provided by a system program to generate a monochromatic function bar background image.
And 102, acquiring a flattened key image, and generating a key code according to the acquired flattened key image and a preset function code.
Step 103, calling a function bar key interface provided by the system program, inputting the generated key code, and generating a function bar key on the upper layer of the function bar background image.
In the embodiment of the invention, the function bar background interface provided by the system program is called to generate the monochromatic function bar background image, the flattened key image is obtained, the key code is generated according to the flattened key image and the preset function code, the function bar key interface provided by the system program is called to input the key code, and the function bar key is generated on the upper layer of the function bar background image, so that the function bar can be generated without adding the self-defined complete code of the function bar into the application program, and the occupation of the application program on the storage resource can be reduced.
Example two
The embodiment of the invention provides a method for generating a function bar, and an execution main body of the method can be terminal equipment, preferably a mobile terminal such as a mobile phone and a tablet personal computer. In this embodiment, the details of the scheme are described by taking an example in which the execution main body is a mobile phone and the operating system is iOS, and the cases of other terminal devices and other operating systems are similar to these cases, and will not be described again here.
The following describes the processing flow shown in fig. 1 in detail with reference to specific processing modes, and the contents may be as follows:
step 101, calling a function bar background interface provided by a system program to generate a monochromatic function bar background image.
The function bar is a bar-shaped area in the application program for setting some internal functions, and the function bar may include a navigation bar at the top, a tool bar at the bottom, and the like. As shown in fig. 2a, 2b, are schematic views of the navigation bar in iOS6 and iOS7, respectively. The function bar may be composed of a function bar background image and function bar keys, and may further include a function bar title. A function bar key is a key in a function bar that is used to trigger execution of one or more functions of an application. The function bar background interface is an interface provided by the system for loading the function bar background image, and the input data of the function bar background interface can be picture or color information.
In implementation, when a user operates a terminal device to start an application program, the user can trigger the terminal to execute a code of the application program, and load an interface of the application program, where the interface may include a function bar, and in the loading process, the function bar background interface provided by a system program may be called to generate a monochromatic function bar background image, and specific generation modes may be various, and several preferable generation modes are given below:
in the first mode, a function bar background interface provided by a system program is called, a preset monochromatic picture is input, and a monochromatic function bar background image is generated.
In implementation, a monochrome picture may be stored in advance in the application program, and the color of the monochrome picture may be set arbitrarily, such as white, where the color is the color of the background image of the ribbon. When the ribbon background interface is called, the monochrome picture may be input to the ribbon background interface, and after the system program receives the monochrome picture through the interface, the size of the monochrome picture is adjusted to a specified size, for example, 640 × 88, and then the adjusted monochrome picture is displayed as a ribbon background image. The means of resizing may include stretching, compressing, and the like.
Preferably, the monochrome picture saved by the application program may be a one-pixel picture, that is, a picture including only one pixel, and the system program may stretch the one-pixel picture to a proper size. Therefore, the data volume of the application program code can be reduced, and the occupation of storage resources is reduced.
And secondly, calling a function bar background interface provided by the system program, inputting a preset background color, and generating a monochromatic function bar background image.
In implementation, the color of the background image of the function bar, i.e., the background color, may be preset in the application program. When the function bar background interface is called, the background color can be input into the function bar background interface, and after the system program receives the background color through the interface, a monochrome picture with the color of the background color and the size of the specified size can be generated and displayed as a function bar background image.
And 102, acquiring a flattened key image, and generating a key code according to the acquired flattened key image and a preset function code.
The key image is an image for displaying the key, and the key image may be composed of a background and a key title. The background may be considered as an outline image of the key. The key header is information describing the key function displayed on the key, and may include description information such as characters and icons. The flattened key image may be a key image without display effects such as edge lines, shading, color transition, etc., may be a key image with a transparent background or a key image with a monochrome background, and preferably, the key image with a monochrome background may be a key image with a monochrome background having the same color as the background image of the function bar. The key titles in the flattened key images may adopt a shadow-free display effect. The function code is a code for executing a key function, and the function code may be used to execute an operation process triggered when a key is clicked, such as page switching, display of a selection window, and the like. The key code is a code for generating a key, which generally needs to be rendered and has a designated function, and accordingly, may be composed of a function code and a key image.
In implementation, the processing of generating the key code according to the obtained flattened key image and the preset function code may be performed in a conventional manner, and is not specifically described in the embodiment of the present invention.
For the case that the function bar is a navigation bar, the navigation bar may include a left button and/or a right button, and accordingly, the processing procedure for obtaining the flattened button image may be as follows:
and (4) left key pressing: determining a left margin corresponding to the version information of the local system program according to the corresponding relation between the pre-stored version information and the left margin; and setting the preset key title of the left key on a transparent background or a monochromatic background according to the determined left distance to generate a flattened key image of the left key.
Wherein, the left distance is the distance between the left end of the key title and the left end of the key image. The version information may be an identification of the system program version, such as 7.0, 6.0, etc. The left button is a button located at the left part of the navigation bar, e.g. "< all contacts" in fig. 2 b.
In implementation, the left margin corresponding to each version of information may be stored in the application program, and when the left margin corresponding to each version of information is set, the sum of the preset distance from the left end of the left button in the system program corresponding to the version of information to the left end of the navigation bar and the left margin corresponding to the version of information may be set to be equal to a preset fixed value, so that the left margin corresponding to each version of information is set, and the positions of the key titles of the left button in the navigation bar when the application program runs under any version of system program may be the same. When obtaining the flattened key image, the version information of the current system program may be obtained first, then the left margin corresponding to the version information is searched, then the transparent background (transparent picture) or the monochromatic background (monochromatic picture) with the predetermined size is obtained, the key title of the left key pre-stored in the application program is obtained, the key title is set on the transparent background or the monochromatic background, the flattened key image of the left key is obtained, and the distance from the left end of the key title to the left end of the key image is equal to the searched left margin.
And (4) right key pressing: determining a right margin corresponding to the version information of the local system program according to the corresponding relation between the pre-stored version information and the right margin; and setting the preset key title of the right key on a transparent background or a monochromatic background according to the determined right margin, and generating a flattened key image of the right key.
Wherein, the right distance is the distance between the right end of the key title and the right end of the key image. The right button is the button located at the right part of the navigation bar, such as "Edit" in fig. 2 b.
In implementation, the process of the right button is similar to that of the left button, and reference is made to the above contents, which will not be described again here.
In the navigation bar, if a left key needs to be set, a flattened key image of the left key is generated according to the processing mode of the left key, and if a right key needs to be set, a flattened key image of the right key is generated according to the processing mode of the right key, and then the processing of the subsequent steps is carried out.
Step 103, calling a function bar key interface provided by the system program, inputting the generated key code, and generating a function bar key on the upper layer of the function bar background image.
The taskbar button interface is an interface for generating a taskbar button based on an input button code provided by a system program, for example, an initwithcustomeview interface in iOS.
In an implementation, the generated key code may be input to the taskbar button interface, and the system program may set a flattened key image of the key code at a designated position of the taskbar background image upon receiving the key code through the interface. The finally generated function bar can be as shown in fig. 3a and 3b, wherein fig. 3a is the navigation bar generated in the iOS6, and fig. 3b is the navigation bar generated in the iOS 7. Therefore, by adopting the method of the embodiment of the invention, the styles of the navigation bars of the application programs are completely the same under systems of different versions.
In the embodiment of the present invention, the following processing may be further included: and generating a function bar title with a shadow-free display effect on the upper layer of the function bar background image.
The function bar header is information for describing the corresponding page content, and is generally located in the middle of the function bar. The tab in fig. 2a is marked with a shadow display effect, and the tab in fig. 3a and 3b is marked with a non-shadow display effect.
By the method for generating the function bar, most characteristics of the function bar, such as various animation effects of the function bar, are still provided and maintained by the system program, and the complete code of the function bar does not need to be added into the application program.
In the embodiment of the invention, the function bar background interface provided by the system program is called to generate the monochromatic function bar background image, the flattened key image is obtained, the key code is generated according to the flattened key image and the preset function code, the function bar key interface provided by the system program is called to input the key code, and the function bar key is generated on the upper layer of the function bar background image, so that the function bar can be generated without adding the self-defined complete code of the function bar into the application program, and the occupation of the application program on the storage resource can be reduced.
EXAMPLE III
Based on the same technical concept, an embodiment of the present invention further provides an apparatus for generating a function bar, as shown in fig. 4, the apparatus includes:
the first generating module 410 is configured to invoke a taskbar background interface provided by a system program to generate a monochrome taskbar background image;
an obtaining module 420, configured to obtain a flattened key image, and generate a key code according to the flattened key image and a preset function code;
the second generating module 430 is configured to invoke a function bar key interface provided by a system program, input the key code, and generate a function bar key on the upper layer of the function bar background image.
Preferably, the first generating module 410 is configured to:
calling a function bar background interface provided by a system program, inputting a preset monochromatic picture, and generating a monochromatic function bar background image; alternatively, the first and second electrodes may be,
and calling a function bar background interface provided by a system program, inputting a preset background color, and generating a monochromatic function bar background image.
Preferably, the flattened key image includes: a transparent background key image or a monochrome background key image.
Preferably, the monochrome background key image includes: and the button image has the same color as the background image of the function bar and has a single-color background.
Preferably, the function bar includes: a navigation bar;
the obtaining module 420 is configured to:
determining a left margin corresponding to the version information of the system program according to a corresponding relation between pre-stored version information and the left margin, wherein the left margin is the distance between the left end of the key title and the left end of the key image; according to the determined left margin, setting a preset key title of the left key on a transparent background or a monochromatic background to generate a flattened key image of the left key; and/or the presence of a gas in the gas,
determining a right margin corresponding to the version information of the system program according to a corresponding relation between pre-stored version information and the right margin, wherein the right margin is the distance between the right end of the key title and the right end of the key image; and setting the preset key title of the right key on a transparent background or a monochromatic background according to the determined right margin, and generating a flattened key image of the right key.
Preferably, the first generating module 410 is further configured to:
and generating a function bar title with a shadow-free display effect on the upper layer of the function bar background image.
In the embodiment of the invention, the function bar background interface provided by the system program is called to generate the monochromatic function bar background image, the flattened key image is obtained, the key code is generated according to the flattened key image and the preset function code, the function bar key interface provided by the system program is called to input the key code, and the function bar key is generated on the upper layer of the function bar background image, so that the function bar can be generated without adding the self-defined complete code of the function bar into the application program, and the occupation of the application program on the storage resource can be reduced.
Example four
Referring to fig. 5, a schematic structural diagram of a terminal with a touch-sensitive surface according to an embodiment of the present invention is shown, where the terminal may be used to implement the method for generating a function bar provided in the foregoing embodiment. Specifically, the method comprises the following steps:
the terminal 900 may include RF (Radio Frequency) circuitry 110, memory 120 including one or more computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, audio circuitry 160, a WiFi (wireless fidelity) module 170, a processor 180 including one or more processing cores, and a power supply 190. Those skilled in the art will appreciate that the terminal structure shown in fig. 5 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 110 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information from a base station and then sends the received downlink information to the one or more processors 180 for processing; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuitry 110 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, the RF circuitry 110 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (short messaging Service), etc.
The memory 120 may be used to store software programs and modules, and the processor 180 executes various functional applications and data processing by operating the software programs and modules stored in the memory 120. The memory 120 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal 900, and the like. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 120 may further include a memory controller to provide the processor 180 and the input unit 130 with access to the memory 120.
The input unit 130 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 130 may include a touch-sensitive surface 131 as well as other input devices 132. The touch-sensitive surface 131, also referred to as a touch display screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 131 (e.g., operations by a user on or near the touch-sensitive surface 131 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 131 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 180, and can receive and execute commands sent by the processor 180. Additionally, the touch-sensitive surface 131 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface 131, the input unit 130 may also include other input devices 132. In particular, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 140 may be used to display information input by or provided to a user and various graphical user interfaces of the terminal 900, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 140 may include a Display panel 141, and optionally, the Display panel 141 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 131 may cover the display panel 141, and when a touch operation is detected on or near the touch-sensitive surface 131, the touch operation is transmitted to the processor 180 to determine the type of the touch event, and then the processor 180 provides a corresponding visual output on the display panel 141 according to the type of the touch event. Although in FIG. 5, touch-sensitive surface 131 and display panel 141 are shown as two separate components to implement input and output functions, in some embodiments, touch-sensitive surface 131 may be integrated with display panel 141 to implement input and output functions.
The terminal 900 can also include at least one sensor 150, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 141 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 141 and/or the backlight when the terminal 900 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor may detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile phone is stationary, and may be used for applications of recognizing gestures of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and tapping), and other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor that may be configured in the terminal 900, which are not described herein again.
Audio circuitry 160, speaker 161, and microphone 162 may provide an audio interface between a user and terminal 900. The audio circuit 160 may transmit the electrical signal converted from the received audio data to the speaker 161, and convert the electrical signal into a sound signal for output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 160, and then outputs the audio data to the processor 180 for processing, and then to the RF circuit 110 to be transmitted to, for example, another terminal, or outputs the audio data to the memory 120 for further processing. The audio circuitry 160 may also include an earbud jack to provide communication of peripheral headphones with the terminal 900.
WiFi belongs to a short-distance wireless transmission technology, and the terminal 900 can help a user send and receive e-mails, browse web pages, access streaming media, and the like through the WiFi module 170, and it provides wireless broadband internet access for the user. Although fig. 5 shows the WiFi module 170, it is understood that it does not belong to the essential constitution of the terminal 900 and can be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 180 is a control center of the terminal 900, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the terminal 900 and processes data by operating or executing software programs and/or modules stored in the memory 120 and calling data stored in the memory 120, thereby performing overall monitoring of the mobile phone. Optionally, processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 180.
Terminal 900 also includes a power supply 190 (e.g., a battery) for powering the various components, which may preferably be logically coupled to processor 180 via a power management system that may be used to manage charging, discharging, and power consumption. The power supply 190 may also include any component including one or more of a dc or ac power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the terminal 900 may further include a camera, a bluetooth module, etc., which will not be described herein. Specifically, in this embodiment, the display unit of the terminal 900 is a touch screen display, the terminal 900 further includes a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for:
calling a function bar background interface provided by a system program to generate a monochromatic function bar background image;
acquiring a flattened key image, and generating a key code according to the flattened key image and a preset function code;
and calling a function bar key interface provided by a system program, inputting the key code, and generating a function bar key on the upper layer of the function bar background image.
Preferably, the invoking a taskbar background interface provided by the system program to generate a monochrome taskbar background image comprises:
calling a function bar background interface provided by a system program, inputting a preset monochromatic picture, and generating a monochromatic function bar background image; alternatively, the first and second electrodes may be,
and calling a function bar background interface provided by a system program, inputting a preset background color, and generating a monochromatic function bar background image.
Preferably, the flattened key image includes: a transparent background key image or a monochrome background key image.
Preferably, the monochrome background key image includes: and the button image has the same color as the background image of the function bar and has a single-color background.
Preferably, the function bar includes: a navigation bar;
the acquiring of the flattened key image includes:
determining a left margin corresponding to the version information of the system program according to a corresponding relation between pre-stored version information and the left margin, wherein the left margin is the distance between the left end of the key title and the left end of the key image; according to the determined left margin, setting a preset key title of the left key on a transparent background or a monochromatic background to generate a flattened key image of the left key; and/or the presence of a gas in the gas,
determining a right margin corresponding to the version information of the system program according to a corresponding relation between pre-stored version information and the right margin, wherein the right margin is the distance between the right end of the key title and the right end of the key image; and setting the preset key title of the right key on a transparent background or a monochromatic background according to the determined right margin, and generating a flattened key image of the right key.
Preferably, the method further comprises:
and generating a function bar title with a shadow-free display effect on the upper layer of the function bar background image.
In the embodiment of the invention, the function bar background interface provided by the system program is called to generate the monochromatic function bar background image, the flattened key image is obtained, the key code is generated according to the flattened key image and the preset function code, the function bar key interface provided by the system program is called to input the key code, and the function bar key is generated on the upper layer of the function bar background image, so that the function bar can be generated without adding the self-defined complete code of the function bar into the application program, and the occupation of the application program on the storage resource can be reduced.
It should be noted that: in the device for generating a function bar according to the above embodiment, when generating a function bar, only the division of each function module is illustrated, and in practical applications, the function distribution may be completed by different function modules according to needs, that is, the internal structure of the device may be divided into different function modules to complete all or part of the functions described above. In addition, the apparatus for generating a function bar and the method embodiment for generating a function bar provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (11)

1. A method of generating a ribbon, the method comprising:
when a terminal is triggered to execute codes of an application program, calling a function bar background interface provided by a system program to generate a monochromatic function bar background image, wherein the function bar background interface is an interface provided by the system and used for loading the function bar background image, the function bar comprises a navigation bar, and a left margin and a right margin corresponding to each version of information are stored in the application program;
acquiring version information of the system program, and determining a left margin corresponding to the version information of the system program according to a corresponding relation between pre-stored version information and the left margin, wherein the left margin is the distance between the left end of a key title and the left end of a key image; according to the determined left margin, setting a preset key title of the left key on a transparent background or a monochromatic background to generate a flattened key image of the left key; and/or the presence of a gas in the gas,
determining a right margin corresponding to the version information of the system program according to a corresponding relation between pre-stored version information and the right margin, wherein the right margin is the distance between the right end of the key title and the right end of the key image; setting a preset key title of a right key on a transparent background or a monochromatic background according to the determined right margin, generating a flattened key image of the right key, and generating a key code according to the flattened key image and a preset function code, wherein the function code is a code for executing a key function, and the key code is a code for generating a key;
and calling a function bar key interface provided by a system program, inputting the key code, and generating a function bar key on the upper layer of the function bar background image.
2. The method of claim 1, wherein the invoking a taskbar background interface provided by a system program to generate a monochrome taskbar background image comprises:
calling a function bar background interface provided by a system program, inputting a preset monochromatic picture, and generating a monochromatic function bar background image; alternatively, the first and second electrodes may be,
and calling a function bar background interface provided by a system program, inputting a preset background color, and generating a monochromatic function bar background image.
3. The method of claim 1, wherein the flattened key image comprises: a transparent background key image or a monochrome background key image.
4. The method of claim 3, wherein the monochrome background key image comprises: and the button image has the same color as the background image of the function bar and has a single-color background.
5. The method of claim 1, further comprising:
and generating a function bar title with a shadow-free display effect on the upper layer of the function bar background image.
6. An apparatus for generating a ribbon, the apparatus comprising:
the system comprises a first generation module, a second generation module and a third generation module, wherein the first generation module is used for calling a function bar background interface provided by a system program to generate a monochromatic function bar background image when a terminal is triggered to execute a code of an application program, the function bar background interface is an interface provided by the system and used for loading the function bar background image, the function bar comprises a navigation bar, and a left margin and a right margin corresponding to each version of information are stored in the application program;
the acquisition module is used for acquiring the version information of the system program and determining a left margin corresponding to the version information of the system program according to the corresponding relation between the pre-stored version information and the left margin, wherein the left margin is the distance between the left end of the key title and the left end of the key image; according to the determined left margin, setting a preset key title of the left key on a transparent background or a monochromatic background to generate a flattened key image of the left key; and/or the presence of a gas in the gas,
determining a right margin corresponding to the version information of the system program according to a corresponding relation between pre-stored version information and the right margin, wherein the right margin is the distance between the right end of the key title and the right end of the key image; setting a preset key title of a right key on a transparent background or a monochromatic background according to the determined right margin, generating a flattened key image of the right key, and generating a key code according to the flattened key image and a preset function code, wherein the function code is a code for executing a key function, and the key code is a code for generating a key;
and the second generation module is used for calling a function bar key interface provided by a system program, inputting the key code and generating a function bar key on the upper layer of the function bar background image.
7. The apparatus of claim 6, wherein the first generating module is configured to:
calling a function bar background interface provided by a system program, inputting a preset monochromatic picture, and generating a monochromatic function bar background image; alternatively, the first and second electrodes may be,
and calling a function bar background interface provided by a system program, inputting a preset background color, and generating a monochromatic function bar background image.
8. The apparatus of claim 6, wherein the flattened key image comprises: a transparent background key image or a monochrome background key image.
9. The apparatus of claim 8, wherein the monochrome background key image comprises: and the button image has the same color as the background image of the function bar and has a single-color background.
10. The apparatus of claim 6, wherein the first generating module is further configured to:
and generating a function bar title with a shadow-free display effect on the upper layer of the function bar background image.
11. A computer-readable storage medium storing at least one instruction which, when executed by a processor, performs a method of generating a ribbon as recited in any one of claims 1-5.
CN201410057497.0A 2014-02-20 2014-02-20 Method and device for generating function bar Active CN104866287B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410057497.0A CN104866287B (en) 2014-02-20 2014-02-20 Method and device for generating function bar

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410057497.0A CN104866287B (en) 2014-02-20 2014-02-20 Method and device for generating function bar

Publications (2)

Publication Number Publication Date
CN104866287A CN104866287A (en) 2015-08-26
CN104866287B true CN104866287B (en) 2020-07-07

Family

ID=53912141

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410057497.0A Active CN104866287B (en) 2014-02-20 2014-02-20 Method and device for generating function bar

Country Status (1)

Country Link
CN (1) CN104866287B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3680760A4 (en) * 2017-09-08 2020-10-14 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Key display method, apparatus, and terminal

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102750134A (en) * 2011-04-18 2012-10-24 北京易信通联信息技术有限公司 Method for generating graphical interface of handheld terminal operating system and handheld terminal
CN103246529A (en) * 2012-02-13 2013-08-14 腾讯科技(深圳)有限公司 Method, equipment and system for updating and pushing navigation bar

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8375325B2 (en) * 2005-12-30 2013-02-12 Google Inc. Customizable, multi-function button
CN103377041A (en) * 2012-04-24 2013-10-30 腾讯科技(深圳)有限公司 Function bar achievement method and device
CN103353838A (en) * 2013-05-30 2013-10-16 北京百度网讯科技有限公司 Method and device for generating function bar in target system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102750134A (en) * 2011-04-18 2012-10-24 北京易信通联信息技术有限公司 Method for generating graphical interface of handheld terminal operating system and handheld terminal
CN103246529A (en) * 2012-02-13 2013-08-14 腾讯科技(深圳)有限公司 Method, equipment and system for updating and pushing navigation bar

Also Published As

Publication number Publication date
CN104866287A (en) 2015-08-26

Similar Documents

Publication Publication Date Title
CN106775637B (en) Page display method and device for application program
US10725646B2 (en) Method and apparatus for switching screen interface and terminal
CN106933525B (en) A kind of method and apparatus showing image
CN104852885B (en) Method, device and system for verifying verification code
CN104238893B (en) A kind of method and apparatus that video preview picture is shown
EP2851779A1 (en) Method, device, storage medium and terminal for displaying a virtual keyboard
CN108549519B (en) Split screen processing method and device, storage medium and electronic equipment
CN105975190B (en) Graphical interface processing method, device and system
CN108958606B (en) Split screen display method and device, storage medium and electronic equipment
WO2018077041A1 (en) Method and apparatus for running application
CN107251536A (en) A kind of mobile terminal shows the method and mobile terminal of multiple application widgets
WO2018006841A1 (en) Qr code information transmission method, device and apparatus
CN105989572B (en) Picture processing method and device
CN107193451B (en) Information display method and device, computer equipment and computer readable storage medium
WO2020007114A1 (en) Method and apparatus for switching split-screen application, storage medium, and electronic device
WO2015010570A1 (en) A method, device, and terminal for hiding or un-hiding content
CN105653112B (en) Method and device for displaying floating layer
CN105635553B (en) Image shooting method and device
CN107479799B (en) Method and device for displaying window
CN106708390B (en) Screen capturing method, device and system
CN113050863A (en) Page switching method and device, storage medium and electronic equipment
CN106919458B (en) Method and device for Hook target kernel function
CN105095161B (en) Method and device for displaying rich text information
CN104238931B (en) Information input method and device and electronic equipment
CN111026457B (en) Hardware configuration method and device, storage medium and terminal equipment

Legal Events

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