Page processing method, device, electronic device and storage medium

By setting the database to manage the navigation bar status in iOS system, the problem of navigation bar being modified by other pages when page switching is solved, and the accurate recovery and isolation of navigation bar status is achieved, ensuring the independence of navigation bars on different pages.

CN114035874BActive Publication Date: 2025-04-15BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111299470.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-04
Publication Date
2025-04-15
Estimated Expiration
2041-11-04

AI Technical Summary

Technical Problem

In iOS system, the navigation bar is globally unique, which causes the navigation bar of the currently displayed page to be modified by other pages, causing the navigation bar status to be displayed abnormally.

Method used

By listening to the setting operation event, use the setting database to determine whether the second page retains the navigation bar status of the first page, and obtain the navigation bar status of the second page from the database if necessary, to ensure that the navigation bar can automatically restore the status before modification after the page is switched.

Benefits of technology

It solves the problem that different pages affect each other when using navigation bars due to page maintenance, and ensures that the navigation bar status of the currently displayed page will not be modified by other pages, so that the navigation bar status is displayed accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114035874B_ABST
    Figure CN114035874B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention is applicable to the field of information processing technology, and provides a page processing method, device, electronic device and storage medium, wherein the page processing method includes: in the case of monitoring a setting operation event, determining whether a second page retains a navigation bar state corresponding to a first page based on a setting database; the setting operation event represents a page switching event in which an application switches from a first page to a second page; the setting database stores a first parameter uploaded when the navigation bar state corresponding to the first page is modified; the first parameter represents whether the second page retains the navigation bar state corresponding to the first page when the first page switches to the second page; in the case that the second page does not retain the navigation bar state corresponding to the first page, obtaining the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event; and loading the navigation bar on the second page based on the obtained navigation bar state corresponding to the second page.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing technology, and in particular to a page processing method, device, electronic device and storage medium. Background Art

[0002] The navigation bar of the current application (App, Application) is maintained by the page, that is, the navigation bar of each page in the App is maintained by the page where the navigation bar is located. The navigation bar in the iOS system is globally unique, and all pages in the App share the same navigation bar. When switching pages, the navigation bar of the currently displayed page may be modified by other pages, resulting in abnormal display of the navigation bar of the currently displayed page. Summary of the invention

[0003] In order to solve the above problems, embodiments of the present invention provide a page processing method, device, electronic device and storage medium to at least solve the problem that when switching pages in the related art, the navigation bar of the currently displayed page may be modified by other pages.

[0004] The technical solution of the present invention is achieved in this way:

[0005] In a first aspect, an embodiment of the present invention provides a page processing method, the method comprising:

[0006] In the case of monitoring a setting operation event, determining whether the second page retains the navigation bar state corresponding to the first page based on the setting database; the setting operation event represents a page switching event in which the application switches from the first page to the second page; the setting database stores a first parameter uploaded when the navigation bar state corresponding to the first page is modified; the first parameter represents whether the second page retains the navigation bar state corresponding to the first page when the first page switches to the second page;

[0007] In a case where the second page does not retain the navigation bar state corresponding to the first page, acquiring the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event;

[0008] Based on the acquired state of the navigation bar corresponding to the second page, the navigation bar is loaded on the second page.

[0009] In the above solution, the acquiring the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event includes:

[0010] In the case where the type of the setting operation event is represented as a push event, the first state is acquired in the setting database; the first state represents the state of the navigation bar corresponding to the first page after the third page is pushed onto the first page;

[0011] The first state is determined as a navigation bar state corresponding to the second page.

[0012] In the above solution, the acquiring the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event includes:

[0013] In the case where the type of the setting operation event is characterized as a pop event, the second state is acquired in the setting database; the second state represents a state of the navigation bar corresponding to the second page before the second page is pushed onto the first page;

[0014] The second state is determined as a navigation bar state corresponding to the second page.

[0015] In the above solution, loading the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page includes:

[0016] Acquire a function module corresponding to the state of the navigation bar corresponding to the second page from a setting function library;

[0017] Based on the application program interface API function in the functional module, the navigation bar is loaded on the second page.

[0018] In the above solution, based on the acquired state of the navigation bar corresponding to the second page, after the second page loads the navigation bar, the method includes:

[0019] The memory address of the second page, the navigation bar state corresponding to the second page and a second parameter are stored in the setting database; the second parameter indicates whether the third page retains the navigation bar state corresponding to the second page when the second page switches to the third page.

[0020] In the above solution, the determining whether the second page retains the navigation bar state corresponding to the first page based on the setting database includes:

[0021] Determine a first parameter corresponding to the memory address of the first page in the setting database;

[0022] Determine whether the second page retains the navigation bar state corresponding to the first page based on the first parameter.

[0023] In the above solution, loading the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page includes:

[0024] determining whether the second page is being displayed;

[0025] When the second page is being displayed, the navigation bar is loaded on the second page based on the acquired state of the navigation bar corresponding to the second page.

[0026] In a second aspect, an embodiment of the present invention provides a page processing device, the device comprising:

[0027] A monitoring module, configured to determine whether the second page retains the navigation bar state corresponding to the first page based on a setting database when a setting operation event is monitored; the setting operation event represents a page switching event in which the application switches from the first page to the second page; the setting database stores a first parameter uploaded when the navigation bar state corresponding to the first page is modified; the first parameter represents whether the second page retains the navigation bar state corresponding to the first page when the first page switches to the second page;

[0028] an acquisition module, configured to acquire the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event when the second page does not retain the navigation bar state corresponding to the first page;

[0029] A loading module is used to load the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page.

[0030] In the above solution, when the acquisition module acquires the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event, it is used to:

[0031] In the case where the type of the setting operation event is represented as a push event, the first state is acquired in the setting database; the first state represents the state of the navigation bar corresponding to the first page after the third page is pushed onto the first page;

[0032] The first state is determined as a navigation bar state corresponding to the second page.

[0033] In the above solution, when the acquisition module acquires the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event, it is used to:

[0034] In the case where the type of the setting operation event is characterized as a pop event, the second state is acquired in the setting database; the second state represents a state of the navigation bar corresponding to the second page before the second page is pushed onto the first page;

[0035] The second state is determined as a navigation bar state corresponding to the second page.

[0036] In the above solution, the loading module is used to, when loading the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page:

[0037] The function module corresponding to the state of the navigation bar corresponding to the second page is obtained from the setting function library; and the navigation bar is loaded on the second page based on the application program interface API function in the function module.

[0038] In the above scheme, the device also includes:

[0039] A storage module is used to store the memory address of the second page, the navigation bar state corresponding to the second page and a second parameter in the setting database; the second parameter indicates whether the third page retains the navigation bar state corresponding to the second page when the second page switches to the third page.

[0040] In the above solution, when the monitoring module determines whether the second page retains the navigation bar state corresponding to the first page based on the setting database, it is used to:

[0041] Determine a first parameter corresponding to the memory address of the first page in the setting database;

[0042] Determine whether the second page retains the navigation bar state corresponding to the first page based on the first parameter.

[0043] In the above solution, the loading module is used to, when loading the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page:

[0044] Determine whether the second page is being displayed; if the second page is being displayed, load the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page.

[0045] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a memory, wherein the processor and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the steps of the page processing method provided in the first aspect of the embodiment of the present invention.

[0046] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, including: the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the page processing method provided in the first aspect of the embodiment of the present invention are implemented.

[0047] In the embodiment of the present invention, when a setting operation event is monitored, it is determined based on the setting database whether the second page retains the navigation bar state corresponding to the first page. When the second page does not retain the navigation bar state corresponding to the first page, the navigation bar state corresponding to the second page is obtained from the setting database based on the type of the setting operation event, and the navigation bar is loaded on the second page based on the obtained navigation bar state corresponding to the second page. The setting operation event represents a page switching event in which the application switches from the first page to the second page; the setting database stores a first parameter uploaded when the navigation bar state corresponding to the first page is modified; the first parameter represents whether the second page retains the navigation bar state corresponding to the first page when the first page switches to the second page. In the embodiment of the present invention, when the navigation bar state is modified, the first page uploads the first parameter to the setting database; when the first page switches pages, it is determined based on the first parameter in the setting database whether the second page retains the navigation bar state corresponding to the first page; when the navigation bar state is not retained, the navigation bar state corresponding to the second page is obtained from the setting database, and the navigation bar is loaded on the second page based on the navigation bar state corresponding to the second page. In the embodiment of the present invention, the navigation bar can automatically restore the state before modification after the page is switched, and the navigation bar state of the currently displayed page will not be modified by other pages, so that the navigation bar state of the currently displayed page is displayed accurately, which solves the problem in the related art that the navigation bar is maintained by the page, resulting in different pages affecting each other when using the navigation bar. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a schematic diagram of an implementation flow of a page processing method provided by an embodiment of the present invention;

[0049] Figure 2 is a schematic diagram of page switching provided by an embodiment of the present invention;

[0050] Figure 3 It is a schematic diagram of page stacking and popping provided by an embodiment of the present invention;

[0051] Figure 4 It is a schematic diagram of the implementation flow of another page processing method provided by an embodiment of the present invention;

[0052] Figure 5 It is a schematic diagram of the implementation flow of another page processing method provided by an embodiment of the present invention;

[0053] Figure 6It is a schematic diagram of the implementation flow of another page processing method provided by an embodiment of the present invention;

[0054] Figure 7 is a schematic diagram of a unified navigation bar management system provided by an application embodiment of the present invention;

[0055] Figure 8 is a schematic diagram of a page processing device provided by an embodiment of the present invention;

[0056] Fig. 9 It is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0058] Currently, mobile apps integrate more and more functions on the navigation bar. For example, the navigation bar of e-commerce apps includes: search box, code scanning, sign-in, sharing, return, photo taking and other functions. In the iOS system, the navigation bar is globally unique, and all pages in the app share the same navigation bar. The navigation bar is maintained by the page. There are the following problems in the iOS system: First, the iOS system has no restrictions on page modification of the navigation bar. The navigation bar state of the currently displayed page will be modified by the page that is not displayed, which will cause the navigation bar state to display abnormally. Second, in order to ensure that different pages do not affect each other when using the navigation bar, the state of the navigation bar before the modification needs to be saved when the page modifies the state of the navigation bar, so that the state of the navigation bar before the modification can be restored when the page is not displayed. This operation is cumbersome and easy to miss. Third, each page must maintain a set of codes corresponding to its navigation bar display, which increases the difficulty of maintenance and code redundancy. Fourth, the official documentation of the application programming interface (API, Application Programming Interface) related to the navigation bar is unclear and cumbersome to use. For example, setting the background of the navigation bar to be transparent requires calling multiple system APIs separately.

[0059] In view of the shortcomings of the above-mentioned related technologies, an embodiment of the present invention provides a page processing method, which can at least prevent the navigation bar of the currently displayed page from being modified by other pages when switching pages. In order to illustrate the technical solution of the present invention, a specific embodiment is used for description below.

[0060] Figure 11 is a schematic diagram of an implementation flow of a page processing method provided by an embodiment of the present invention. The execution subject of the page processing method is an electronic device, and the electronic device includes a desktop computer, a notebook computer, and a server. Figure 1 , the page processing methods include:

[0061] S101, when a setting operation event is monitored, determining whether the second page retains the navigation bar state corresponding to the first page based on a setting database; the setting operation event represents a page switching event in which the application switches from the first page to the second page; the setting database stores a first parameter uploaded when the navigation bar state corresponding to the first page is modified; the first parameter represents whether the second page retains the navigation bar state corresponding to the first page when the first page switches to the second page.

[0062] Here, the navigation bar status guides the display effect of the navigation bar on the page, such as the background, transparency and size of the navigation bar.

[0063] The setting operation event refers to the page switching that occurs in the application, such as switching from the first page to the second page. Figure 2 is a schematic diagram of a page switching provided by an embodiment of the present invention. Figure 2 In the example, the first page can be the home page, and the second page can be the store page. Switching from the home page to the store page is a page switching event. Alternatively, the first page is the store page, and the second page is the product details page. Switching from the store page to the product details page is also a page switching event.

[0064] The switching here includes both page push events and page pop events. Push refers to pushing into the stack, and pop refers to pointing out of the stack. Figure 3 As shown, Figure 3 Schematic diagram of page stacking and popping provided by an embodiment of the present invention. Figure 3 In the example, if the user clicks the Buy Now button on the product details page, the page will be pushed to the order confirmation page. If the user clicks the Confirm Payment button on the order confirmation page, the page will be pushed to the payment success page. The payment success page is pushed to the stack, and the order confirmation page remains in the stack and does not pop out of the stack. If the user clicks the Back button in the upper left corner of the payment success page to return to the product details page, both the order confirmation page and the payment success page will pop out of the stack.

[0065] When the App starts, create a listener to listen for push and pop events. When a push or pop event is detected, determine whether the second page retains the navigation bar state corresponding to the first page based on the setting database. The setting operation events detected here include: the first page is pushed to the second page, or the first page is popped to the second page.

[0066] Here, the App sets up a setting database correspondingly, which stores the first parameter uploaded when the state of the navigation bar corresponding to the first page is modified; the first parameter indicates whether the second page retains the state of the navigation bar corresponding to the first page when the first page switches to the second page.

[0067] The state of the navigation bar corresponding to the first page will be modified in two situations: one is that the logic of the push or pop event may modify the navigation bar, and the other is that the page actively modifies the navigation bar. Each page may correspond to different businesses. For example, the home page, store page, and product detail page have different requirements for the navigation bar. Therefore, when entering the store page from the home page, the store page will actively modify the state of the navigation bar and set the state of the navigation bar to the style required by page 2. Generally speaking, all pages of the App will actively modify the state of the navigation bar, even the home page will modify the state of the navigation bar. Usually, the navigation bar has an initialization state, and the home page will modify the navigation bar from the initialization state to its corresponding state.

[0068] The modification of the navigation bar status will trigger the upload of the first parameter. The first parameter indicates whether the second page retains the navigation bar status corresponding to the first page when the first page switches to the second page. For example, when the first page modifies the navigation bar status, after pushing the first page to the second page, whether the second page retains the navigation bar status corresponding to the first page is saved in the setting database; and after popping the first page to the second page, whether the second page retains the navigation bar status corresponding to the first page is saved in the setting database; the current navigation bar status of the first page can also be saved in the setting database. Here, the first parameter can be saved in the setting database in the form of a Boolean value.

[0069] In the setting database, the first parameter is stored in a one-to-one correspondence with the memory address of the first page. When a setting operation event is monitored, it is determined whether the corresponding first parameter is stored in the setting database through the memory address of the first page. If there is a first parameter, it is determined whether the second page retains the navigation bar state corresponding to the first page through the value of the first parameter.

[0070] S102: When the second page does not retain the navigation bar state corresponding to the first page, obtain the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event.

[0071] There are two types of setting operation events, one is push event and the other is pop event. Push means to push into the stack, and pop means to pull out of the stack. Different types of setting operation events have different corresponding navigation bar states for the second page obtained from the setting database.

[0072] For example, if it is a push event, the navigation bar state corresponding to the second page may be the navigation bar state before the first page actively modifies the navigation bar state.

[0073] refer to Figure 4 In one embodiment, the acquiring the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event includes:

[0074] S401, when the type of the setting operation event is represented by a push event, obtaining the first state in the setting database; the first state represents the state of the navigation bar corresponding to the first page after the third page is pushed onto the first page.

[0075] The first state refers to the state of the navigation bar before the first page actively modifies the state of the navigation bar, and also refers to the state of the navigation bar of the first page after the third page is pushed onto the first page. Figure 2 For example, assuming that the third page refers to the home page, the first page refers to the store page, and the second page refers to the product details page. The first state refers to the state of the navigation bar before the store page actively modifies the state of the navigation bar, and also refers to the state of the navigation bar of the store page after entering the store page from the home page.

[0076] For example, before the first page actively modifies the state of the navigation bar, the navigation bar has a blue background. Later, the first page actively modifies the background color of the navigation bar to red, and the first state is the state of the navigation bar when the navigation bar has a blue background.

[0077] The setting database stores the state of the navigation bar corresponding to the first page before and after modification. The memory address of the push page (first page) is used as the key to obtain the first state of the first page in the setting database.

[0078] In the setting database, the state of the navigation bar is stored as a state parameter. For example, if the page changes the navigation bar to transparent, the function enumeration value of the navigation bar being transparent is stored in the setting database.

[0079] S402: Determine the first state as a navigation bar state corresponding to the second page.

[0080] The first state is used as the navigation bar state corresponding to the second page, and after switching to the second page, the navigation bar is loaded in the first state on the second page.

[0081] Popping and pushing are relative, and pushing first can pop. If it is a pop event, the navigation bar state corresponding to the second page can be the navigation bar state of the second page before the second page is pushed onto the first page.

[0082] refer to Figure 5, the acquiring the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event includes:

[0083] S501, when the type of the setting operation event is characterized as a pop event, obtaining the second state in the setting database; the second state represents the state of the navigation bar corresponding to the second page before the second page is pushed onto the first page.

[0084] Here, the second state refers to the state of the navigation bar corresponding to the second page before the second page is pushed onto the first page. Because the second page may actively modify the navigation bar, first determine whether the setting database includes the state of the navigation bar after the second page modifies the state of the navigation bar. If so, the second state refers to the state of the navigation bar after the second page modifies the state of the navigation bar. If not, the second state refers to the state of the navigation bar before the first page actively modifies the state of the navigation bar.

[0085] After each page modifies the navigation bar state or a setting operation event occurs, the state of the navigation bar state of the corresponding page before and after the modification will be stored in the setting database.

[0086] If the second page has actively modified the navigation bar, the memory address of the second page is used as the key to obtain the second state in the setting database. If the second page has not actively modified the navigation bar, the address of the first page is used as the key to obtain the second state in the setting database.

[0087] S502: Determine the second state as a navigation bar state corresponding to the second page.

[0088] The second state is used as the navigation bar state corresponding to the second page, and after switching to the second page, the navigation bar is loaded in the second state on the second page.

[0089] S103: Load the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page.

[0090] In the settings database, the state of the navigation bar is stored as a state parameter, and the parameter is also passed when the page changes the state of the navigation bar. For example, if the page changes the navigation bar to transparent, the function enumeration value of the navigation bar transparent will be passed.

[0091] A navigation bar state may correspond to multiple function enumeration values, each function enumeration value corresponds to a system API, and these APIs are used to implement the corresponding navigation bar state on the page.

[0092] By calling the API corresponding to the navigation bar state, the navigation bar is loaded on the second page based on the navigation bar state corresponding to the second page.

[0093] In one embodiment, loading the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page includes:

[0094] Acquire a function module corresponding to the state of the navigation bar corresponding to the second page from a setting function library;

[0095] Based on the application program interface API function in the functional module, the navigation bar is loaded on the second page.

[0096] Here, the system API is encapsulated with functions as the granularity, providing functions such as background setting, transparency setting, gradient effect, and customized UI. The state of the navigation bar corresponding to the second page is stored in the setting database as state parameters, and the state parameters and function modules in the setting function library are set to correspond one to one. By searching the function module corresponding to the state parameter in the setting function library and executing the API in the corresponding function module, the navigation bar is loaded on the second page based on the state of the navigation bar corresponding to the second page.

[0097] The embodiment of the present invention encapsulates the navigation bar related API based on function granularity and opens it to the page in the form of function modules. Compared with the related art that each page needs to maintain a set of codes corresponding to its navigation bar display, the embodiment of the present invention reduces the difficulty of page maintenance and code redundancy.

[0098] In the related art, the navigation bar is maintained by the page, and it is possible that the state of the navigation bar of the currently displayed page is modified by the page that is not currently displayed. For example, when entering the store page from the home page, the store page continues to display the state of the navigation bar of the home page, and does not display the state of the navigation bar corresponding to the store page. It is also possible that the store page displays the state of the navigation bar of the product details page. In the embodiment of the present invention, when any page modifies the state of the navigation bar, the first parameter will be stored in the setting database. When switching pages, the state of the navigation bar can be accurately restored through the first parameter to avoid the incorrect state of the navigation bar displayed on the current page.

[0099] In the embodiment of the present invention, when a setting operation event is monitored, it is determined based on the setting database whether the second page retains the navigation bar state corresponding to the first page. When the second page does not retain the navigation bar state corresponding to the first page, the navigation bar state corresponding to the second page is obtained from the setting database based on the type of the setting operation event, and the navigation bar is loaded on the second page based on the obtained navigation bar state corresponding to the second page. The setting operation event represents a page switching event in which the application switches from the first page to the second page; the setting database stores a first parameter uploaded when the navigation bar state corresponding to the first page is modified; the first parameter represents whether the second page retains the navigation bar state corresponding to the first page when the first page switches to the second page. In the embodiment of the present invention, when the navigation bar state is modified, the first page uploads the first parameter to the setting database; when the first page switches pages, it is determined based on the first parameter in the setting database whether the second page retains the navigation bar state corresponding to the first page; when the navigation bar state is not retained, the navigation bar state corresponding to the second page is obtained from the setting database, and the navigation bar is loaded on the second page based on the navigation bar state corresponding to the second page. In the embodiment of the present invention, the navigation bar can automatically restore the state before modification after the page is switched, and the navigation bar state of the currently displayed page will not be modified by other pages, so that the navigation bar state of the currently displayed page is displayed accurately, which solves the problem in the related art that the navigation bar is maintained by the page, resulting in different pages affecting each other when using the navigation bar.

[0100] In one embodiment, based on the acquired state of the navigation bar corresponding to the second page, after the second page loads the navigation bar, the method includes:

[0101] The memory address of the second page, the navigation bar state corresponding to the second page and a second parameter are stored in the setting database; the second parameter indicates whether the third page retains the navigation bar state corresponding to the second page when the second page switches to the third page.

[0102] The memory address of the second page, the navigation bar state corresponding to the second page, and the second parameter are stored in the setting database, so that the navigation bar state can be determined when the second page is subsequently switched.

[0103] refer to Figure 6 In one embodiment, loading the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page includes:

[0104] S601: Determine whether the second page is being displayed.

[0105] S602: When the second page is being displayed, load the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page.

[0106] Since the iOS system has no restrictions on page modification of the navigation bar, the navigation bar state of the currently displayed page may be modified by the currently undisplayed page, which may cause the navigation bar state to display abnormally. When modifying the navigation bar, the embodiment of the present invention determines whether the page for modifying the navigation bar state is being displayed. If it is being displayed, the operation of modifying the navigation bar state is performed. If it is not being displayed, an error is reported. The embodiment of the present invention can prevent the navigation bar state of the currently displayed page from being modified by the undisplayed page, thereby preventing the navigation bar state of the page from displaying abnormally.

[0107] refer to Figure 7 , Figure 7 is a schematic diagram of a unified navigation bar management system provided by an application embodiment of the present invention. Figure 7 In the page stacking and popping navigation bar logic, for push events, the unified navigation bar management system obtains the push page and the pushed page through the page stack of the navigation controller (navigation Controller), uses the memory address of the push page as the key, and determines whether to retain the current navigation bar state after the push based on local data. If it is or there is no value, the process ends. "End of process" means that the push and pop logic processing is over. If the navigation bar is modified, the logical process of "modifying the navigation bar" will be re-entered. If the current navigation bar state is not retained, the state of the push page's navigation bar before modification is obtained from the local data, and the read state value and the pushed page are used as parameters to call the API of the unified navigation bar management system to modify the navigation bar state. Here, the push page is pushed onto the pushed page. The state of the push page's navigation bar before modification refers to: the state of the push page's navigation bar before the push page actively modifies the navigation bar state.

[0108] For pop events, the unified navigation bar management system obtains the pop page and pop target page through the page stack of the navigation controller (navigation Controller). Here, the pop page is popped from the stack to the pop target page. The memory address of the pop page is used as the key to read whether the current navigation bar state is retained after the pop in the local data. If it is or there is no value, the process ends. If not, the memory address of the pop target page is used as the key to read the modified state of the navigation bar of the pop target page in the local data. If there is a state value, the read state value and the pop target page are used as parameters to call the API of the unified navigation bar management system to modify the state of the navigation bar; if there is no value, the address of the pop page is used as the key to read the state of the pop page navigation bar before modification in the local data. Based on the read state value and the pop target page as parameters, the API of the unified navigation bar management system is called to modify the state of the navigation bar.

[0109] The local data is the setting database in the above embodiment. When any page modifies the state of the navigation bar, three parameters will be transmitted to the unified management system of the navigation bar and stored in the local data.

[0110] For example, page 1 is pushed to page 2, and page 2 is pushed to page 3. If page 2 modifies the navigation bar to transparent, three parameters need to be passed. Parameter 1: the function enumeration value for setting the navigation bar to transparent; Parameter 2: whether to retain the state after push, which means whether the modified state of the navigation bar of page 2 is retained for page 3 after page 2 pushes page 3. Parameter 3: whether to retain the state after pop, which means whether the modified state of the navigation bar of page 2 is retained for page 1 when page 2 is popped to page 1. "Whether to retain the current navigation bar state after push" means: whether the modified state of the navigation bar of the push page is retained for the pushed page.

[0111] "The modified state of the navigation bar of the pop target page" refers to the modified state of page 2. If there is a value, that is, page 2 has been modified, the navigation bar restores the modified state of page 2. If there is no value, that is, page 2 has not been modified, the navigation bar restores the state before page 3 is modified, that is, page 2 uses the state before page 3 is modified.

[0112] The unified navigation bar management system will also determine whether the page for modifying the navigation bar status is being displayed. If it is being displayed, the modification operation will be performed, otherwise an error will be reported and returned.

[0113] Furthermore, the navigation bar related APIs are encapsulated based on the function granularity and opened to the page in the form of function modules. When modifying the state of the navigation bar, the function module specified by the parameters is searched in the function library, and the native API in the corresponding function module is executed to modify the state of the navigation bar. After the state of the navigation bar is modified, the modified state is also saved in the local data to facilitate the subsequent restoration of the state of the navigation bar.

[0114] The application embodiment of the present invention maintains and modifies the state of the navigation bar of the page through a unified management system of the navigation bar, thereby solving the shortcoming that the navigation bar is maintained by the page. The application embodiment of the present invention can automatically restore the state before modification after the page is switched, and the state of the navigation bar of the currently displayed page will not be modified by other pages, so that the state of the navigation bar of the currently displayed page is accurately displayed, solving the shortcoming in the related art that the navigation bar is maintained by the page, causing different pages to affect each other when using the navigation bar.

[0115] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0116] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0117] It should be noted that the technical solutions described in the embodiments of the present invention can be arbitrarily combined without conflict.

[0118] In addition, in the embodiments of the present invention, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0119] refer to Figure 8 , Figure 8 is a schematic diagram of a page processing device provided by an embodiment of the present invention, such as Figure 8 As shown, the device includes: a monitoring module, an acquisition module and a loading module.

[0120] A monitoring module, configured to determine whether the second page retains the navigation bar state corresponding to the first page based on a setting database when a setting operation event is monitored; the setting operation event represents a page switching event in which the application switches from the first page to the second page; the setting database stores a first parameter uploaded when the navigation bar state corresponding to the first page is modified; the first parameter represents whether the second page retains the navigation bar state corresponding to the first page when the first page switches to the second page;

[0121] an acquisition module, configured to acquire the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event when the second page does not retain the navigation bar state corresponding to the first page;

[0122] A loading module is used to load the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page.

[0123] In one embodiment, when the acquisition module acquires the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event, it is configured to:

[0124] In the case where the type of the setting operation event is represented as a push event, the first state is acquired in the setting database; the first state represents the state of the navigation bar corresponding to the first page after the third page is pushed onto the first page;

[0125] The first state is determined as a navigation bar state corresponding to the second page.

[0126] In one embodiment, when the acquisition module acquires the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event, it is configured to:

[0127] In the case where the type of the setting operation event is characterized as a pop event, the second state is acquired in the setting database; the second state represents a state of the navigation bar corresponding to the second page before the second page is pushed onto the first page;

[0128] The second state is determined as a navigation bar state corresponding to the second page.

[0129] In one embodiment, the loading module is configured to, when loading the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page,:

[0130] Acquire a function module corresponding to the state of the navigation bar corresponding to the second page from a setting function library;

[0131] Based on the application program interface API function in the functional module, the navigation bar is loaded on the second page.

[0132] In one embodiment, the device further comprises:

[0133] A storage module is used to store the memory address of the second page, the navigation bar state corresponding to the second page and a second parameter in the setting database; the second parameter indicates whether the third page retains the navigation bar state corresponding to the second page when the second page switches to the third page.

[0134] In one embodiment, when determining whether the second page retains the navigation bar state corresponding to the first page based on the setting database, the monitoring module is used to:

[0135] Determine a first parameter corresponding to the memory address of the first page in the setting database;

[0136] Determine whether the second page retains the navigation bar state corresponding to the first page based on the first parameter.

[0137] In one embodiment, the loading module is configured to, when loading the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page,:

[0138] determining whether the second page is being displayed;

[0139] When the second page is being displayed, the navigation bar is loaded on the second page based on the acquired state of the navigation bar corresponding to the second page.

[0140] In actual application, the monitoring module, acquisition module and loading module can be implemented by a processor in an electronic device, such as a central processing unit (CPU), a digital signal processor (DSP), a microcontroller unit (MCU) or a programmable gate array (FPGA).

[0141] It should be noted that: the page processing device provided in the above embodiment only uses the division of the above modules as an example when performing page processing. In actual applications, the above processing can be assigned to different modules as needed, that is, the internal structure of the device is divided into different modules to complete all or part of the processing described above. In addition, the page processing device provided in the above embodiment and the page processing method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0142] Based on the hardware implementation of the above program modules and in order to implement the method of the embodiment of the present application, the embodiment of the present application also provides an electronic device. Fig. 9 Schematic diagram of the hardware structure of the electronic device of the present application embodiment. Fig. 9 As shown, the electronic equipment includes:

[0143] Communication interface, which can exchange information with other devices such as network equipment;

[0144] The processor is connected to the communication interface to realize information exchange with other devices, and is used to execute the method provided by one or more technical solutions of the electronic device side when running the computer program. The computer program is stored in the memory.

[0145] Of course, in actual applications, the various components in the electronic device are coupled together through the bus system. It is understandable that the bus system is used to achieve connection and communication between these components. In addition to the data bus, the bus system also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Fig. 9 In the specification, various buses are labeled as bus systems.

[0146] The memory in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on the electronic device.

[0147] It can be understood that the memory can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memories described in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.

[0148] The method disclosed in the above embodiment of the present application can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory, and the processor reads the program in the memory and completes the steps of the above method in combination with its hardware.

[0149] Optionally, when the processor executes the program, the corresponding processes implemented by the electronic device in each method of the embodiments of the present application are implemented, which will not be described in detail here for the sake of brevity.

[0150] In an exemplary embodiment, the present application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, including a first memory storing a computer program, and the computer program can be executed by a processor of an electronic device to complete the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.

[0151] In the several embodiments provided in the present application, it should be understood that the disclosed devices, electronic devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0152] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0153] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0154] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, disks or optical disks.

[0155] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0156] It should be noted that the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.

[0157] In addition, in the examples of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0158] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A page processing method, characterized in that: The method comprises: In the case of monitoring a setting operation event, determining whether the second page retains the navigation bar state corresponding to the first page based on the setting database; the setting operation event represents a page switching event in which the application switches from the first page to the second page; the setting database stores a first parameter uploaded when the navigation bar state corresponding to the first page is modified; the first parameter represents whether the second page retains the navigation bar state corresponding to the first page when the first page switches to the second page; In a case where the second page does not retain the navigation bar state corresponding to the first page, acquiring the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event; Based on the acquired state of the navigation bar corresponding to the second page, loading the navigation bar on the second page; The acquiring the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event includes: In the case where the type of the setting operation event is characterized as a push event, the state of the navigation bar corresponding to the second page is determined based on the state of the navigation bar corresponding to the first page after the third page is pushed onto the first page; or, in the case where the type of the setting operation event is characterized as a pop event, the state of the navigation bar corresponding to the second page is determined based on the state of the navigation bar corresponding to the second page before the second page is pushed onto the first page.

2. The method according to claim 1, characterized in that The loading of the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page includes: Acquire a function module corresponding to the state of the navigation bar corresponding to the second page from a setting function library; Based on the application program interface API function in the functional module, the navigation bar is loaded on the second page.

3. The method according to claim 1, characterized in that Based on the acquired state of the navigation bar corresponding to the second page, after the second page loads the navigation bar, the method includes: The memory address of the second page, the navigation bar state corresponding to the second page and a second parameter are stored in the setting database; the second parameter indicates whether the third page retains the navigation bar state corresponding to the second page when the second page switches to the third page.

4. The method according to claim 1, characterized in that The determining, based on the setting database, whether the second page retains the navigation bar state corresponding to the first page includes: Determine a first parameter corresponding to the memory address of the first page in the setting database; Determine whether the second page retains the navigation bar state corresponding to the first page based on the first parameter.

5. The method according to claim 1, characterized in that The loading of the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page includes: determining whether the second page is being displayed; When the second page is being displayed, the navigation bar is loaded on the second page based on the acquired state of the navigation bar corresponding to the second page.

6. A page processing device, characterized in that: include: A monitoring module, configured to determine whether the second page retains the navigation bar state corresponding to the first page based on the setting database when a setting operation event is monitored; The setting operation event represents a page switching event in which the application switches from the first page to the second page; the setting database stores a first parameter uploaded when the state of the navigation bar corresponding to the first page is modified; The first parameter indicates whether the second page retains the navigation bar state corresponding to the first page when the first page switches to the second page; an acquisition module, configured to acquire the navigation bar state corresponding to the second page from the setting database based on the type of the setting operation event when the second page does not retain the navigation bar state corresponding to the first page; A loading module, configured to load the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page; An acquisition module is used to determine the state of the navigation bar corresponding to the second page based on the state of the navigation bar corresponding to the first page after the third page is pushed onto the first page when the type of the setting operation event is characterized as a push event; or to determine the state of the navigation bar corresponding to the second page based on the state of the navigation bar corresponding to the second page before the second page is pushed onto the first page when the type of the setting operation event is characterized as a pop event.

7. The device according to claim 6, characterized in that The loading module is configured to, when loading the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page: The function module corresponding to the state of the navigation bar corresponding to the second page is obtained from the setting function library; and the navigation bar is loaded on the second page based on the application program interface API function in the function module.

8. The device according to claim 6, characterized in that The device also includes: A storage module is used to store the memory address of the second page, the navigation bar state corresponding to the second page and a second parameter in the setting database; the second parameter indicates whether the third page retains the navigation bar state corresponding to the second page when the second page switches to the third page.

9. The device according to claim 6, characterized in that When the monitoring module determines whether the second page retains the navigation bar state corresponding to the first page based on the setting database, it is used to: Determine a first parameter corresponding to the memory address of the first page in the setting database; Determine whether the second page retains the navigation bar state corresponding to the first page based on the first parameter.

10. The device according to claim 6, characterized in that The loading module is configured to, when loading the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page: Determine whether the second page is being displayed; if the second page is being displayed, load the navigation bar on the second page based on the acquired state of the navigation bar corresponding to the second page.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the page processing method according to any one of claims 1 to 5 is implemented.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the page processing method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and device for page interaction

    CN102819553A

  • Method and device for displaying pages

    CN107544809A