CN111427652A - User-defined button display method, device, medium and computer equipment - Google Patents

User-defined button display method, device, medium and computer equipment Download PDF

Info

Publication number
CN111427652A
CN111427652A CN202010244706.8A CN202010244706A CN111427652A CN 111427652 A CN111427652 A CN 111427652A CN 202010244706 A CN202010244706 A CN 202010244706A CN 111427652 A CN111427652 A CN 111427652A
Authority
CN
China
Prior art keywords
button
displayed
attribute information
layout file
rendering
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.)
Granted
Application number
CN202010244706.8A
Other languages
Chinese (zh)
Other versions
CN111427652B (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.)
Suning Cloud Computing Co Ltd
Original Assignee
Suning Cloud Computing 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 Suning Cloud Computing Co Ltd filed Critical Suning Cloud Computing Co Ltd
Priority to CN202010244706.8A priority Critical patent/CN111427652B/en
Publication of CN111427652A publication Critical patent/CN111427652A/en
Application granted granted Critical
Publication of CN111427652B publication Critical patent/CN111427652B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Abstract

The application relates to a display method of a user-defined button. The method comprises the following steps: acquiring an interface layout file of a current interface; creating each custom button of the current interface according to the interface layout file; acquiring attribute information of a button to be displayed in the user-defined button according to a preset operation strategy and the interface layout file; and rendering and displaying the button to be displayed according to the attribute information. According to the method and the device, the user-defined button to be displayed can be obtained based on the operation strategy, the rendering is executed when the button needs to be displayed, and resources are saved.

Description

User-defined button display method, device, medium and computer equipment
Technology critical domain
The present application relates to button interaction technology domains, and in particular, to a method, an apparatus, a medium, and a computer device for displaying a user-defined button.
Background
In the existing iOS system, a UIBotton button of the system is provided and is mainly used for displaying common button styles, such as pure colors, background pictures and other common styles.
However, when the terminal displays the general buttons, a commonly adopted scheme is to create each button when entering an interface, and perform rendering when the button creation is completed.
In the conventional technical scheme, rendering is executed when the button is created, which results in more mobile phone memory consumption and influences the reasonable allocation of system resources.
Disclosure of Invention
Therefore, in order to solve the above technical problems, it is necessary to provide a method and an apparatus for displaying a custom button, a computer device, and a storage medium, which can implement rendering only when the button needs to be displayed based on an operation policy, thereby saving resources.
A method for displaying a custom button comprises the following steps:
acquiring an interface layout file of a current interface;
creating each user-defined button of the current interface according to the interface layout file;
acquiring attribute information of a button to be displayed in the user-defined button according to a preset operation strategy and an interface layout file;
and rendering and displaying the button to be displayed according to the attribute information.
In one embodiment, the obtaining attribute information of the button to be displayed in the custom button according to the preset operation policy and the interface layout file includes:
acquiring a button identifier of a button to be displayed corresponding to the current operation moment according to an operation strategy;
and acquiring attribute information corresponding to the button to be displayed according to the button identifier and the interface layout file.
In one embodiment, when the button to be displayed is a gradient color button, obtaining attribute information of the button to be displayed in the custom button according to a preset operation policy and an interface layout file includes:
extracting attribute information of a gradient color button in an interface layout file, wherein the attribute information comprises a preset color value array, a rendering starting point, a gradient point and a rendering end point;
the color value array comprises a plurality of color values, and the rendering and displaying of the button to be displayed according to the attribute information comprises the following steps:
and rendering and displaying the gradient button according to the plurality of color values, the rendering starting point, the gradient point and the rendering end point.
In one embodiment, the creating of each custom button of the current interface according to the interface layout file includes:
acquiring a universal button class file according to the header file;
creating button classes of each self-defined button according to the general button class file;
and creating each custom button according to the button class of each custom button.
In one embodiment, the method further includes:
setting the state attribute of each user-defined button according to the attribute information;
and when a network request instruction acting on a target button on the current interface is received, updating the display state of the target button according to the state attribute of the target button and the network request instruction.
In one embodiment, the updating the display state of the target button according to the state attribute of the target button and the network request command includes:
acquiring a current network request state;
determining button display data of a target button according to the current network request state;
and updating the display state of the target button according to the button display data.
A custom button display device, the device comprising:
the acquisition module is used for acquiring an interface layout file of a current interface;
the creation module is used for creating each custom button of the current interface according to the interface layout file;
the processing module is used for acquiring attribute information of a button to be displayed in the user-defined button according to a preset operation strategy and the interface layout file;
and the display module is used for rendering and displaying the button to be displayed according to the attribute information.
In one embodiment, the processing module includes:
the processing unit is used for acquiring the button identification of the button to be displayed corresponding to the current operation time according to the operation strategy;
and acquiring attribute information corresponding to the button to be displayed according to the button identification and the interface layout file.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of any of the above embodiments when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any of the above embodiments.
According to the display method and device of the user-defined button and the computer equipment, the interface layout file of the current interface is obtained; creating each user-defined button of the current interface according to the interface layout file; acquiring attribute information of a button to be displayed in the user-defined button according to a preset operation strategy and an interface layout file; and rendering and displaying the button to be displayed according to the attribute information. According to the method and the device, the user-defined button to be displayed can be obtained based on the operation strategy, the rendering is executed when the button needs to be displayed, and resources are saved.
Drawings
FIG. 1 is a diagram of an application environment of a method for presenting custom buttons in an exemplary embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for displaying custom buttons provided in an exemplary embodiment of the present application;
FIG. 3 is a block diagram of a device for presenting customized buttons provided in an exemplary embodiment of the present application;
fig. 4 is an internal structural diagram of a computer device provided in an exemplary embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The display method of the user-defined button in the embodiment of the application can be applied to electronic equipment. The electronic device may be, but is not limited to, a mobile phone, a notebook, a tablet computer, and the like. Fig. 1 is a schematic diagram of an internal structure of an electronic device in an embodiment. The electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor is configured to provide computational and control capabilities. The memory includes a nonvolatile storage medium and an internal memory. The nonvolatile storage medium stores an operating system and further comprises a display device of a user-defined button, and the display device is used for realizing a display method of the user-defined button. The internal memory provides an environment for running the computer program in the nonvolatile storage medium. The display screen is used for displaying the display result of the user-defined button, and the display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer equipment can be a touch layer covered on a display screen, a key, a track ball or a touch pad arranged on a shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
In one embodiment, as shown in fig. 2, a method for displaying a custom button is provided, which is described by taking the method as an example applied to the terminal in fig. 1, and includes the following steps:
and S21, acquiring the interface layout file of the current interface.
In one embodiment, the interface layout file may include layout information of each button, and the button layout information may include, but is not limited to, the position, shape, and status of the button.
And S22, creating each self-defining button of the current interface according to the interface layout file.
In one embodiment, the terminal creates an object corresponding to each button according to the interface layout file, and extracts the custom button of the current interface. Specifically, the interface layout file comprises layout information corresponding to each button, the layout information of the custom button in the interface layout file is extracted according to the layout information corresponding to each button, and each custom button in the interface layout file is created according to the layout information of the custom button.
And S23, acquiring attribute information of the button to be displayed in the user-defined button according to a preset operation strategy and the interface layout file.
In one embodiment, the above-mentioned operation policy means that in the operation case, rendering is performed on the displayed or about to be displayed button, and rendering is not performed on the button which is not displayed yet. For example, there are two gradient buttons on the current interface of the current APP, one displayed in the first area of the current interface and the other displayed in the second area. When entering the current interface, the interface data of the first area is firstly displayed, so that only the buttons of the first area need to be subjected to background gradient color rendering at the moment, and the buttons in the second area perform gradient rendering only when the buttons are displayed on a screen. The application can save system resources through the operation strategy.
In an embodiment, the interface layout file includes button identifiers of the buttons and layout information of the buttons corresponding to the button identifiers. The layout information may include attribute information of the respective buttons. The attribute information may include basic attributes of the button and state attributes. The basic properties may include button style, button position, rendering mode, whether to allow clicking, not setting default allowed clicking, and the like. The button styles described above may include background color, font size, fillet settings, and the like. The state attribute includes initial state data, pressed state, released state, loaded state data, loaded completed state data, and the like. The rendering manner may include a rendering start point, a rendering end point, a rendering color value, and the like.
And S24, rendering and displaying the button to be displayed according to the attribute information.
In one embodiment, the terminal draws the button according to information such as a button style, a button position and the like in the attribute information, sets the button according to the basic attribute and the state attribute, and further performs rendering and display on the button to be displayed according to a rendering mode.
In one embodiment, the obtaining attribute information of the button to be displayed in the custom button according to the preset operation policy and the interface layout file may include:
acquiring a button identifier of a button to be displayed corresponding to the current operation moment according to an operation strategy;
and acquiring attribute information corresponding to the button to be displayed according to the button identifier and the interface layout file.
In one embodiment, when the current interface is displayed, the buttons displayed at each running time are different, the terminal obtains the button identifier of the button to be displayed corresponding to the current time, and obtains the corresponding attribute information according to the button identifier and the interface layout file. The interface layout file comprises button identifications and layout information of buttons corresponding to the button identifications.
However, in the conventional technical solution, when the interface is up, each button on the interface is created according to the interface layout file, and rendering of each button is executed, which may cause more mobile phone memory to be consumed and system resources to be occupied. According to the method and the device, the buttons needing to be displayed at the running time are rendered through the running strategy, and system resources are saved.
In one embodiment, when the button to be displayed is a gradient color button, the obtaining attribute information of the button to be displayed in the custom button according to the preset operation policy and the interface layout file may include:
extracting attribute information of a gradient color button in an interface layout file, wherein the attribute information comprises a preset color value array, a rendering starting point, a gradient point and a rendering end point;
the above color value array includes a plurality of color values, and the rendering and displaying the button to be displayed according to the attribute information may include:
and rendering and displaying the gradient button according to the plurality of color values, the rendering starting point, the gradient point and the rendering end point.
In one embodiment, the color value array may include two or more color values. The gradation point mentioned above refers to a position where the color is changed. When the color array includes two color values corresponding to the color a and the color B, the corresponding gradient point is one. And the terminal performs rendering from the rendering starting point to the gradient point by using the color A, and then performs rendering of the whole gradient color button from the gradient point to the rendering end point by using the color B.
In one embodiment, the interface layout file includes a header file of a preset generic button class file, and the creating each custom button of the current interface according to the interface layout file may include:
acquiring a universal button class file according to the header file;
creating button classes of each self-defined button according to the general button class file;
and creating each custom button according to the button class of each custom button.
In an embodiment, the interface layout file includes a header file of a preset common button (commonfutton) class, the terminal acquires the commonfutton class, creates a button class of each custom button according to the commonfutton class, and creates an object of each custom button according to the button class of each custom button.
Taking the implementation of the gradient color button as an example, in the conventional technical solution, since the conventional technical solution modifies the gradient color of the background through the layer classes provided by the system. When button gradual change needs to be realized, when button rendering is executed on a created button, a background layer needs to be newly established, attribute information of the background layer is set, and a gradually changed color value is given to the newly established background layer to realize the rendering.
However, this application establishes self-defined button based on predetermined general button class, when realizing the gradual change, only needs to acquire the button picture layer of itself, and further, according to the preset colour value that the developer introduced into in advance, the execution is played up, has simplified the step of playing up, promotes the treatment effeciency. In addition, on one side of the developer, the developer does not need to create a new layer every time when the developer creates the button, and sets a plurality of attribute information of the layer, and only needs to transmit color values, so that the developer can design the custom button conveniently to a great extent.
In one embodiment, the method may further include:
setting the state attribute of each user-defined button according to the attribute information;
and when a network request instruction acting on a target button on the current interface is received, updating the display state of the target button according to the state attribute of the target button and the network request instruction.
In one embodiment, the updating the display state of the target button according to the state attribute of the target button and the network request command may include:
acquiring a current network request state;
determining button display data of a target button according to the current network request state;
and updating the display state of the target button according to the button display data.
In one embodiment, the button display data may include text, pictures, and animation data displayed on the button. The network request state may include a state before network loading, i.e., a state before button pressing, a state in network loading, a state in which network loading is completed, and the like. The state attribute may include a button style before the button is pressed, a button style in network loading, a button style after network loading is completed, and the like, wherein the button style is the button display data.
In one embodiment, the method further includes:
creating a button layer of each custom button;
the rendering and displaying the button to be displayed according to the attribute information may include:
acquiring a button layer of a button to be displayed;
and rendering the button layer according to the attribute information, and displaying the button layer on the current interface.
In one embodiment, when the user-defined button is rendered, the layer of the button itself is obtained, that is, the button layer is rendered. However, in the conventional technical solution, when rendering the gradient color button, a new button layer needs to be created, and then the new button layer is subjected to background modification with gradient color, so as to implement rendering of the gradient color button.
In one possible application scenario 1, when a developer designs a custom button, the design flow is as follows:
step 1: customizing a common Button of the Button type;
step 2: enumerating several commonly used button style types such as round corner rectangles, capsule styles, loading styles, character styles, gradient styles and the like according to visual specifications, performing type enumeration, and initializing and setting the button styles in the development process;
and step 3: setting the necessary attribute of the user-defined button, which is used for setting the relevant basic information of the CommonButton button;
step 3-1: setting a common button style;
step 3-2: setting a warning button pattern, namely a main warning button pattern and a secondary warning button pattern;
step 3-3: setting related properties such as background color, frame color and character color of forbidden buttons, allowing clicking or not, and not setting default allowed clicking;
and 4, step 4: modifying the button style, namely, after initialization, carrying out style setting on the button to ensure that the button meets the service requirement;
step 4-1: setting button styles according to necessary attributes related to setting buttons, such as background colors, font sizes and fillet settings;
step 4-2: setting background color, performing operation during operation, and rendering the background style of the button; and acquiring a layer for generating a background color during operation, carrying out parameter designation on the initialized background color array, the rendering starting point and the rendering ending point, rendering the color group on the layer, and finishing the rendering of the background color.
And 5: setting the button style of the loading state, namely whether characters are displayed or not and whether pictures exist or not; setting picture names, and displaying pictures in loading; the picture is not transmitted, and the picture is not displayed during loading;
step 6: and defining a method for hiding the loaded picture after the loading is finished.
In the step 2, several types of button styles commonly used, such as rounded rectangles, capsule styles, loading styles, text styles, gradient styles and the like, can be displayed on a terminal interface of a developer for the developer to select, so that the problem that the developer needs to design the button styles by himself in the traditional technical scheme is solved, and the method is convenient and fast. The application scene is suitable for the condition that the fixed style meets the service requirement, namely the button style is fixed and does not need to be set by a developer.
In another possible application scenario 2, when the developer designs the custom button, the design flow is as follows:
step 1: customizing a common Button of the Button type;
step 2: enumerating several commonly used button style types such as round corner rectangles, capsule styles, loading styles, character styles, gradient styles and the like according to visual specifications, performing type enumeration, and initializing and setting the button styles in the development process;
and step 3: setting the necessary attribute of the user-defined button, which is used for setting the relevant basic information of the CommonButton button;
step 3-1: setting a common button style;
step 3-2: setting a warning button pattern, namely a main warning button pattern and a secondary warning button pattern;
step 3-3: setting related properties such as background color, frame color and character color of forbidden buttons, allowing clicking or not, and not setting default allowed clicking;
and 4, step 4: setting the independent style of the button, setting necessary attributes such as style, background color and fillet size, and finishing the processing required by the self-defined button service;
step 4-1: setting a main style display when the button is pressed according to the transmitted button style, recording the main style of the button, and setting the button pressing style and the released style;
step 4-2: setting background gradient of the button according to the transmitted gradient color number group, if 1 color is transmitted, setting the background gradient as a pure color, otherwise, setting a gradient background color mode;
step 4-3: self-defining the fillet radius of the corner of the button;
step 4-4: the rendering mode of the button is the same as the rendering mode of the fixed style;
and 5: setting an initial attribute method of a button style, recording the border color, the border width and the original character color of a user-defined style button, if the border attribute is not set, indicating that the border is not displayed, and setting the attributes for restoring the style of the button;
step 6: and defining a method for hiding the loaded picture after the loading is finished.
The application scene is suitable for the situation that fixed styles cannot meet business requirements, and the styles of the custom buttons in the scene need to be preset by a developer, for example, the gradient color buttons need to be transmitted into a color value array by the developer in advance.
In one embodiment, as shown in fig. 3, there is provided a presentation apparatus of custom buttons, comprising:
an obtaining module 31, configured to obtain an interface layout file of a current interface;
a creating module 32, configured to create each custom button of the current interface according to the interface layout file;
the processing module 33 is configured to obtain attribute information of a button to be displayed in the custom button according to a preset operation policy and the interface layout file;
and the display module 34 is used for rendering and displaying the buttons to be displayed according to the attribute information.
In one embodiment, the processing module 33 includes:
the processing unit is used for acquiring the button identification of the button to be displayed corresponding to the current operation time according to the operation strategy;
and acquiring attribute information corresponding to the button to be displayed according to the button identifier and the interface layout file.
In one embodiment, when the button to be displayed is a gradient button, the processing module 33 is further configured to:
extracting attribute information of a gradient color button in an interface layout file, wherein the attribute information comprises a preset color value array, a rendering starting point, a gradient point and a rendering end point;
the color value array includes a plurality of color values, and the display module 34 includes:
and the display unit is used for rendering and displaying the gradient button according to the plurality of color values, the rendering starting point, the gradient point and the rendering end point.
In one embodiment, the interface layout file includes a header file of a preset generic button class file, and the creating module 32 includes:
the creating unit is used for acquiring the universal button class file according to the header file;
creating button classes of each self-defined button according to the general button class file;
and creating each custom button according to the button class of each custom button.
In one embodiment, the creating module 32 is further configured to set a status attribute of each custom button according to the attribute information;
and when a network request instruction acting on a target button on the current interface is received, updating the display state of the target button according to the state attribute of the target button and the network request instruction.
In one embodiment, the status attribute includes button display data corresponding to a plurality of network request statuses, and the creating module 32 is further configured to obtain a current network request status;
determining button display data of a target button according to the current network request state;
and updating the display state of the target button according to the button display data.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 4. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide the determining and controlling capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of presenting a custom button. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program: acquiring an interface layout file of a current interface; creating each user-defined button of the current interface according to the interface layout file; acquiring attribute information of a button to be displayed in the user-defined button according to a preset operation strategy and an interface layout file; and rendering and displaying the button to be displayed according to the attribute information.
In one embodiment, when the processor executes the computer program to implement the step of obtaining the attribute information of the button to be displayed in the custom button according to the preset operation policy and the interface layout file, the following steps are specifically implemented:
acquiring a button identifier of a button to be displayed corresponding to the current operation moment according to an operation strategy;
and acquiring attribute information corresponding to the button to be displayed according to the button identifier and the interface layout file.
In an embodiment, when the button to be displayed is a gradient color button, the processor executes the computer program to implement the step of obtaining the attribute information of the button to be displayed in the custom button according to the preset operation policy and the interface layout file, and specifically implements the following steps:
extracting attribute information of a gradient color button in an interface layout file, wherein the attribute information comprises a preset color value array, a rendering starting point, a gradient point and a rendering end point;
when the processor executes the computer program to realize the steps of rendering and displaying the button to be displayed according to the attribute information, the following steps are specifically realized:
and rendering and displaying the gradient button according to the plurality of color values, the rendering starting point, the gradient point and the rendering end point.
In one embodiment, the interface layout file includes a header file of a preset generic button class file, and the following steps are specifically implemented when the processor executes the computer program to implement the step of creating each custom button of the current interface according to the interface layout file:
acquiring a universal button class file according to the header file;
creating button classes of each self-defined button according to the general button class file;
and creating each custom button according to the button class of each custom button.
In one embodiment, the processor, when executing the computer program, implements the steps of:
setting the state attribute of each user-defined button according to the attribute information;
and when a network request instruction acting on a target button on the current interface is received, updating the display state of the target button according to the state attribute of the target button and the network request instruction.
In one embodiment, the state attribute includes button display data corresponding to a plurality of network request states, and the processor executes the computer program to implement the step of updating the display state of the target button according to the state attribute of the target button and the network request instruction, and specifically implements the following steps:
acquiring a current network request state;
determining button display data of a target button according to the current network request state;
and updating the display state of the target button according to the button display data. When a plurality of characteristic vector steps are carried out, the following steps are specifically realized:
in one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring an interface layout file of a current interface; creating each user-defined button of the current interface according to the interface layout file; acquiring attribute information of a button to be displayed in the user-defined button according to a preset operation strategy and an interface layout file; and rendering and displaying the button to be displayed according to the attribute information.
In one embodiment, when the computer program is executed by the processor to implement the step of obtaining the attribute information of the button to be displayed in the custom button according to the preset operation policy and the interface layout file, the following steps are specifically implemented:
acquiring a button identifier of a button to be displayed corresponding to the current operation moment according to an operation strategy;
and acquiring attribute information corresponding to the button to be displayed according to the button identifier and the interface layout file.
In an embodiment, when the button to be displayed is a gradient color button, the computer program is executed by the processor to implement the step of obtaining the attribute information of the button to be displayed in the custom button according to the preset operation policy and the interface layout file, and the following steps are specifically implemented:
extracting attribute information of a gradient color button in an interface layout file, wherein the attribute information comprises a preset color value array, a rendering starting point, a gradient point and a rendering end point;
the color value array comprises a plurality of color values, and when the computer program is executed by the processor to realize the steps of rendering according to the attribute information and displaying the button to be displayed, the following steps are specifically realized:
and rendering and displaying the gradient button according to the plurality of color values, the rendering starting point, the gradient point and the rendering end point.
In an embodiment, the interface layout file includes a header file of a preset generic button class file, and when the computer program is executed by the processor to implement the step of creating each custom button of the current interface according to the interface layout file, the following steps are specifically implemented:
acquiring a universal button class file according to the header file;
creating button classes of each self-defined button according to the general button class file;
and creating each custom button according to the button class of each custom button.
In one embodiment, the computer program, when executed by a processor, embodies the steps of:
setting the state attribute of each user-defined button according to the attribute information;
and when a network request instruction acting on a target button on the current interface is received, updating the display state of the target button according to the state attribute of the target button and the network request instruction.
In an embodiment, the state attribute includes button display data corresponding to a plurality of network request states, and when the computer program is executed by the processor to implement the step of updating the display state of the target button according to the state attribute of the target button and the network request instruction, the following steps are specifically implemented:
acquiring a current network request state;
determining button display data of a target button according to the current network request state;
and updating the display state of the target button according to the button display data.
Those of ordinary skill in the art will appreciate that all or a portion of the processes of the methods of the embodiments described above may be implemented by hardware associated with instructions from a computer program, which may be stored on a non-volatile computer-readable storage medium, which when executed, may include the processes of the embodiments of the methods described above, wherein any reference to memory, storage, physical tables, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the protection scope of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for displaying a custom button, the method comprising:
acquiring an interface layout file of a current interface;
creating each custom button of the current interface according to the interface layout file;
acquiring attribute information of a button to be displayed in the user-defined button according to a preset operation strategy and the interface layout file;
and rendering and displaying the button to be displayed according to the attribute information.
2. The method according to claim 1, wherein the obtaining attribute information of a button to be displayed in the custom button according to a preset operation policy and the interface layout file comprises:
acquiring a button identifier of a button to be displayed corresponding to the current operation moment according to the operation strategy;
and acquiring attribute information corresponding to the button to be displayed according to the button identification and the interface layout file.
3. The method according to claim 1, wherein when the button to be displayed is a gradient color button, the obtaining attribute information of the button to be displayed in the custom button according to a preset operation policy and the interface layout file includes:
extracting attribute information of the gradient button in the interface layout file, wherein the attribute information comprises a preset color value array, a rendering starting point, a gradient point and a rendering end point;
the color value array comprises a plurality of color values, the button to be displayed is rendered and displayed according to the attribute information, and the method comprises the following steps:
and rendering and displaying the gradient button according to the color values, the rendering starting point, the gradient point and the rendering end point.
4. The method according to claim 1, wherein the interface layout file includes a header file of a preset generic button class file, and the creating each custom button of the current interface according to the interface layout file includes:
acquiring the universal button class file according to the header file;
creating button classes of each self-defined button according to the general button class file;
and creating each custom button according to the button class of each custom button.
5. The method of claim 1, further comprising:
setting the state attribute of each user-defined button according to the attribute information;
and when a network request instruction acting on a target button on the current interface is received, updating the display state of the target button according to the state attribute of the target button and the network request instruction.
6. The method of claim 5, wherein the status attribute comprises button display data corresponding to a plurality of network request statuses, and wherein updating the display status of the target button according to the status attribute of the target button and the network request command comprises:
acquiring a current network request state;
determining button display data of the target button according to the current network request state;
and updating the display state of the target button according to the button display data.
7. A custom button display device, the device comprising:
the acquisition module is used for acquiring an interface layout file of a current interface;
the creation module is used for creating each custom button of the current interface according to the interface layout file;
the processing module is used for acquiring attribute information of a button to be displayed in the user-defined button according to a preset operation strategy and the interface layout file;
and the display module is used for rendering and displaying the button to be displayed according to the attribute information.
8. The apparatus of claim 7, wherein the processing module comprises:
the processing unit is used for acquiring the button identification of the button to be displayed corresponding to the current operation time according to the operation strategy;
and acquiring attribute information corresponding to the button to be displayed according to the button identification and the interface layout file.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method for presenting a custom button of any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for presentation of a custom button according to any one of claims 1 to 6.
CN202010244706.8A 2020-03-31 2020-03-31 Display method, device, medium and computer equipment of custom button Active CN111427652B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010244706.8A CN111427652B (en) 2020-03-31 2020-03-31 Display method, device, medium and computer equipment of custom button

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010244706.8A CN111427652B (en) 2020-03-31 2020-03-31 Display method, device, medium and computer equipment of custom button

Publications (2)

Publication Number Publication Date
CN111427652A true CN111427652A (en) 2020-07-17
CN111427652B CN111427652B (en) 2023-05-19

Family

ID=71550253

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010244706.8A Active CN111427652B (en) 2020-03-31 2020-03-31 Display method, device, medium and computer equipment of custom button

Country Status (1)

Country Link
CN (1) CN111427652B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112418997A (en) * 2020-12-03 2021-02-26 政采云有限公司 User interface display method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017097137A1 (en) * 2015-12-09 2017-06-15 阿里巴巴集团控股有限公司 Interface element background image display method, apparatus and intelligent device
CN107451296A (en) * 2017-08-21 2017-12-08 南京焦点领动云计算技术有限公司 A kind of Website Module rendering intent based on component
CN108829485A (en) * 2018-06-25 2018-11-16 腾讯科技(深圳)有限公司 Update method, device, storage medium and the computer equipment of application interface layout
CN109683978A (en) * 2017-10-17 2019-04-26 阿里巴巴集团控股有限公司 A kind of method, apparatus and electronic equipment of the rendering of streaming layout interface

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017097137A1 (en) * 2015-12-09 2017-06-15 阿里巴巴集团控股有限公司 Interface element background image display method, apparatus and intelligent device
CN107451296A (en) * 2017-08-21 2017-12-08 南京焦点领动云计算技术有限公司 A kind of Website Module rendering intent based on component
CN109683978A (en) * 2017-10-17 2019-04-26 阿里巴巴集团控股有限公司 A kind of method, apparatus and electronic equipment of the rendering of streaming layout interface
CN108829485A (en) * 2018-06-25 2018-11-16 腾讯科技(深圳)有限公司 Update method, device, storage medium and the computer equipment of application interface layout

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112418997A (en) * 2020-12-03 2021-02-26 政采云有限公司 User interface display method, device, equipment and medium

Also Published As

Publication number Publication date
CN111427652B (en) 2023-05-19

Similar Documents

Publication Publication Date Title
CN106484396B (en) Night mode switching method and device and terminal equipment
US20160246475A1 (en) Dynamic icon recoloring to improve contrast
WO2020001234A1 (en) Folder icon display method, system, readable storage medium and terminal
US20130044123A1 (en) User-specified image colorization for application user interface
US20190325562A1 (en) Window rendering method and terminal
US11922543B2 (en) Device and method for coloring sketch image with color pointer
CN107295388A (en) Boot animation starts method, device and readable storage medium storing program for executing
CN112445564A (en) Interface display method, electronic device and computer readable storage medium
CN111427652A (en) User-defined button display method, device, medium and computer equipment
CN104793937A (en) Start-up control method and device
CN112799801A (en) Method, device, equipment and medium for drawing simulation mouse pointer
CN114863008B (en) Image processing method, image processing device, electronic equipment and storage medium
WO2016138703A1 (en) Standby interface processing method, device and computer storage medium
CN106506805A (en) Head portrait of contact person generation method and device
WO2022156663A1 (en) Application program management method and apparatus, and electronic device
WO2022100326A1 (en) Electronic device and inter-device screen collaboration method and medium thereof
CN114237795A (en) Terminal interface display method and device, electronic equipment and readable storage medium
US20180088743A1 (en) Image forming apparatus and storage medium
CN114237481A (en) Handwriting display processing method, system, device, equipment and storage medium
CN112445501A (en) Data burning method and device and computer readable storage medium
CN112040160A (en) Display parameter setting method and device, multimedia equipment and storage medium
CN110908684A (en) Method and device for updating silk-screen information of configuration page memory
CN112653788A (en) User interface display method and mobile terminal
CN110109663B (en) Method for setting full screen and related device
US20230325581A1 (en) Font Switching Method and Electronic Device

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
GR01 Patent grant
GR01 Patent grant