Mixing application interface display method and device, equipment, storage medium and product

By blocking the navigation bar of the imperative user interface frame in the hybrid application and creating navigation bar components, the interface display abnormality caused by the mixing of different user interface frames is solved, and the interface display effect of the hybrid application is improved.

CN120162045APending Publication Date: 2025-06-17GUANGZHOU BAIGUOYUAN NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510223970.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

The mixed use of different user interface frameworks is prone to interface display abnormalities in mixed application, resulting in poor interface display effect.

Method used

When generating a declarative user interface with a navigation bar in a hybrid application, the navigation bar of the imperative user interface frame is blocked, the navigation bar component is created, and the first navigation bar is configured through the navigation bar component, the first content view of the declarative user interface frame is passed to the navigation bar component, the first content view is set as a subview through the navigation bar component, and the target content view of the navigation bar component is displayed through the view controller compatible with the imperative user interface frame.

Benefits of technology

By blocking the navigation bar of the imperative user interface frame and combining displaying the content views of the navigation bar components and declarative user interface frames, the interface display abnormalities caused by the mixing of different user interface frames is reduced, and the interface display effect of mixed applications is effectively improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120162045A_ABST
    Figure CN120162045A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a mixed application interface display method and device, equipment, a storage medium and a product. According to the technical scheme provided by the embodiment of the invention, when the declarative user interface with the navigation bar is generated in the mixed application, the navigation bar of the imperative user interface framework is shielded, the navigation bar component is created, the first navigation bar is configured through the navigation bar component, and the first content view of the declarative user interface framework is transmitted to the navigation bar component; a first content view is set to be a sub-view through a navigation bar assembly, a target content view of the navigation bar assembly is displayed through a view controller compatible with a imperative user interface framework, the target content view comprises a view of a first navigation bar and the sub-view, and while it is guaranteed that the navigation bar and the content view are correctly displayed, the display efficiency of the navigation bar assembly is improved. The situation of abnormal interface display caused by mixed use of different user interface frames is reduced, and the interface display effect of the mixed application is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of computer technology, and in particular, to a method, apparatus, device, storage medium, and product for displaying a mixed-coded application interface. Background Art

[0002] With the development of computer technology and application development, different types of user interface frameworks have emerged. In application development, there is a situation where different user interface frameworks are mixed. The mixed-coded applications generated by this application development method often have compatibility problems with different user interface frameworks. For example, traditional imperative user interface frameworks (such as UIKit) have become very mature and stable after years of development. However, with the development of technology and the increasing demand of users for a smoother and more dynamic user experience, declarative user interface frameworks (such as SwiftUI) have been introduced. Declarative user interface frameworks have been widely welcomed by developers due to their concise syntax, powerful preview functions, and cross-platform features. However, since declarative user interface frameworks are relatively new and the ecosystem and function perfection degree are not as good as those of imperative user interface frameworks, in actual projects, it is often necessary to mix declarative user interface frameworks and imperative user interface frameworks.

[0003] Since there are significant differences in the implementation mechanisms and lifecycle management between declarative user interface frameworks and imperative user interface frameworks, in related technologies, directly calling declarative user interface frameworks and imperative user interface frameworks is likely to cause problems such as abnormal interface display, and the interface display effect of mixed-coded applications is poor. Summary of the Invention

[0004] Embodiments of the present application provide a method, apparatus, device, storage medium, and product for displaying a mixed-coded application interface to solve the technical problem in related technologies that the mixing of different user interface frameworks is likely to cause abnormal interface display and the interface display effect of mixed-coded applications is poor, and can reduce the situation of abnormal interface display caused by the mixing of different user interface frameworks, and effectively improve the interface display effect of mixed-coded applications.

[0005] In a first aspect, embodiments of the present application provide a method for displaying a mixed-coded application interface, including:

[0006] When generating a declarative user interface with a navigation bar in a mixed-coded application, shielding the navigation bar of the imperative user interface framework, creating a navigation bar component, and configuring a first navigation bar through the navigation bar component, where the mixed-coded application is configured with an imperative user interface framework and a declarative user interface framework;

[0007] Transmitting a first content view of the declarative user interface framework to the navigation bar component, and setting the first content view as a sub-view through the navigation bar component;

[0008] Display the target content view of the navigation bar component through a view controller compatible with the imperative user interface framework, where the target content view includes the view of the first navigation bar and the sub-view.

[0009] In a second aspect, an embodiment of the present application provides a hybrid application interface display device, including a shielding processing module, a view configuration module, and a display processing module, where:

[0010] The shielding processing module is configured to, when generating a declarative user interface with a navigation bar in a hybrid application, shield the navigation bar of the imperative user interface framework, create a navigation bar component, and configure a first navigation bar through the navigation bar component, where the hybrid application is configured with an imperative user interface framework and a declarative user interface framework;

[0011] The view configuration module is configured to pass the first content view of the declarative user interface framework to the navigation bar component, and set the first content view as a sub-view through the navigation bar component;

[0012] The display processing module is configured to display the target content view of the navigation bar component through a view controller compatible with the imperative user interface framework, where the target content view includes the view of the first navigation bar and the sub-view.

[0013] In a third aspect, an embodiment of the present application provides a hybrid application interface display device, including: a memory and one or more processors;

[0014] The memory is used to store one or more programs;

[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the hybrid application interface display method as described in the first aspect.

[0016] In a fourth aspect, an embodiment of the present application provides a non-volatile storage medium storing computer-executable instructions, where the computer-executable instructions are used to execute the hybrid application interface display method as described in the first aspect when executed by a computer processor.

[0017] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device executes the hybrid application interface display method as described in the first aspect.

[0018] When generating a declarative user interface with a navigation bar in a mixed application, this application shields the navigation bar of the imperative user interface framework, creates a navigation bar component, configures the first navigation bar through the navigation bar component, passes the first content view of the declarative user interface framework to the navigation bar component, sets the first content view as a sub-view through the navigation bar component, and displays the target content view of the navigation bar component through a view controller that is compatible with the imperative user interface framework. The target content view includes the view of the first navigation bar and the sub-view. By shielding the navigation bar of the imperative user interface framework and combining the display of the navigation bar component and the first content view of the declarative user interface framework, while ensuring the correct display of the navigation bar and the content view, it reduces the situation of abnormal interface display caused by the mixed use of different user interface frameworks, and effectively improves the interface display effect of the mixed application. Description of the Drawings

[0019] Figure 1 is a flowchart of a method for displaying a mixed application interface provided by an embodiment of this application;

[0020] Figure 2 is a flowchart of another method for displaying a mixed application interface provided by an embodiment of this application;

[0021] Figure 3 is a schematic structural diagram of a device for displaying a mixed application interface provided by an embodiment of this application;

[0022] Figure 4 is a schematic structural diagram of a device for displaying a mixed application interface provided by an embodiment of this application. Detailed Embodiments

[0023] In order to make the objectives, technical solutions, and advantages of this application clearer, the following further describes the specific embodiments of this application in detail with reference to the accompanying drawings. It can be understood that the specific embodiments described herein are only used to explain this application, rather than limiting this application. Additionally, it should be noted that for the sake of description, only parts related to this application are shown in the accompanying drawings, rather than all the content. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can be rearranged. When the operations are completed, the above-mentioned process can be terminated, but there can also be additional steps not included in the drawings. The above-mentioned process can correspond to methods, functions, procedures, subroutines, subprograms, etc.

[0024] The mixed application interface display method provided by this application can be applied to the display of the application interface of a mixed application based on an imperative user interface framework and a declarative user interface framework. It aims to reduce the occurrence of abnormal interface display caused by the mixed use of different user interface frameworks while ensuring the correct display of the navigation bar and the content view by shielding the navigation bar of the imperative user interface framework and combining the display of the navigation bar component (NaviBar) and the first content view of the declarative user interface framework, effectively improving the interface display effect of the mixed application.

[0025] In the existing mobile application development, the user interface framework has undergone a paradigm shift from an imperative user interface framework to a declarative user interface framework. The declarative user interface framework has been widely welcomed by developers for its concise syntax, powerful preview function, and cross-platform characteristics. However, due to the relatively new declarative user interface framework, the ecosystem and functional perfection degree are not as good as those of the imperative user interface framework. Therefore, in actual projects, especially in large or complex applications, it is often necessary to mix the declarative user interface framework and the imperative user interface framework to generate a mixed application that combines the declarative user interface framework and the imperative user interface framework.

[0026] The mixed use of different user interface frameworks brings challenges to navigation management. The imperative user interface framework relies on view controllers (UINavigationController and UIViewController) to provide a mature navigation mechanism, including page stack management, transition animations, and gesture returns. The declarative user interface framework uses view controls (NavigationLink and NavigationStack). There are significant differences in the implementation mechanisms and lifecycle management between the views of the imperative user interface framework and the declarative user interface framework, and they cannot be simply and directly called. Taking the example of opening a declarative user interface framework page through the navigation of the imperative user interface framework, it is necessary to call UIHostingController to wrap the declarative user interface framework page, then handle the corresponding delegate callbacks that need to be implemented under the imperative user interface framework, and then call the push API provided by UINavigationController for page navigation.

[0027] However, the logic for opening an imperative user interface framework page from a declarative user interface framework page is completely different: the UIView / UIViewController needs to be wrapped into a declarative user interface framework View structure that implements the UIViewRepresentable / UIViewControllerRepresentable protocol, and then the navigation API of the declarative user interface framework itself is called to implement the corresponding page navigation function.

[0028] In view of the drawbacks of the native solutions of the system, there are some third-party libraries used to solve the navigation problem, but these solutions generally focus on solving the navigation problems within the declarative user interface framework itself. For example, making the NavigationStack compatible with older system versions on its own and using a more user-friendly API to solve the problem that the concept of the native navigation API is too complex. However, this solution still cannot solve the problem that it is inconvenient to call between the declarative user interface framework and the imperative user interface framework, and the interface display effect of the hybrid application is poor.

[0029] Based on this, an interface display method for hybrid applications in the embodiments of the present application is provided. By uniformly using the view controllers of the imperative user interface framework to manage the jumps of all pages (including between declarative user interface framework pages, between imperative user interface framework pages, and across-frame jumps between declarative user interface framework pages and imperative user interface framework pages), and combining a page navigation tool class to shield the system default navigation bar, a custom navigation bar is implemented through a navigation bar component, and a unified imperative user interface framework interface (AIP) is used for all page navigation jumps within the hybrid application, so as to simplify the application development of the hybrid framework, improve maintainability and development efficiency, make full use of the mature navigation mechanism of the imperative user interface framework, and also conform to the actual scenario where the hybrid application development is mainly based on the imperative user interface framework and supplemented by the declarative user interface framework, which can better be compatible with the display effects of all pages in the app, and effectively solve the technical problems that the mixed use of different user interface frameworks in existing hybrid applications is prone to abnormal interface display and the interface display effect of hybrid applications is poor.

[0030] Figure 1 The flowchart of an interface display method for hybrid applications provided by the embodiments of the present application is given. The interface display method for hybrid applications provided by the embodiments of the present application can be executed by an interface display device for hybrid applications, and the interface display device for hybrid applications can be implemented in a hardware and / or software manner and integrated in an interface display device for hybrid applications.

[0031] The following description is made by taking the interface display device for hybrid applications executing the interface display method for hybrid applications as an example.

[0032] Refer to Figure 1, the method for displaying a mixed-coded application interface includes:

[0033] S110: When generating a declarative user interface with a navigation bar in a mixed-coded application, the navigation bar of the imperative user interface framework is blocked, a navigation bar component is created, and a first navigation bar is configured through the navigation bar component. The mixed-coded application is configured with an imperative user interface framework and a declarative user interface framework.

[0034] The mixed-coded application provided in this application can be installed in a device for displaying a mixed-coded application interface, and the mixed-coded application is configured with an imperative user interface framework and a declarative user interface framework. The display of some application interfaces in the mixed-coded application can be developed based on the imperative user interface framework and / or the declarative user interface framework.

[0035] Exemplarily, when the mixed-coded application needs to generate a declarative user interface with a navigation bar, the navigation bar of the imperative user interface framework is blocked, and the navigation bar of the imperative user interface framework will no longer be displayed in the subsequent displayed interface.

[0036] To avoid unexpected effects caused by each page of the declarative user interface framework implementing its own navigation bar, this application can stipulate that the navigation bar of the declarative user interface framework is implemented separately through the navigation bar component, and other pages of the declarative user interface framework do not implement their own navigation bars, but instead achieve the final complete view by combining a custom navigation bar view and the content view of the declarative user interface framework.

[0037] In one embodiment, when the mixed-coded application needs to generate a declarative user interface with a navigation bar, a navigation bar component can be created. Among them, the navigation bar component can be used to implement a custom system navigation bar. The navigation bar component can support custom titles, back buttons, and top background views, and a first navigation bar can be configured through the navigation bar component. Among them, the navigation bar component can configure relevant parameters of the first navigation bar, such as whether to localize the title, whether to hide the back button, whether to display the top background, etc. The navigation bar component can also receive a specified view as its sub-view. When rendering the navigation bar component, the rendered picture includes the navigation bar component and the image corresponding to the sub-view. Optionally, the navigation bar component can be embedded into the imperative user interface framework to use the navigation bar component in the imperative user interface framework.

[0038] S120: Pass the first content view of the declarative user interface framework to the navigation bar component, and set the first content view as the sub-view through the navigation bar component.

[0039] Exemplarily, obtain the first content view of the declarative user interface framework that needs to be displayed, and pass the first content view to the navigation bar component. After receiving the first content view, the navigation bar component can set the first content view as the sub-view.

[0040] S130: Display the target content view of the navigation bar component through a view controller that is compatible with the imperative user interface framework. The target content view includes the view of the first navigation bar and sub-views.

[0041] Exemplarily, display the target content view of the navigation bar component through a UI view controller (UIViewController) that is compatible with the imperative user interface framework. At this time, the content displayed in the target content view includes the view of the first navigation bar and sub-views, realizing the combined display of the navigation bar and the content view of the declarative user interface framework.

[0042] Among them, the view controller is implemented through a utility class (CommonHosting). The utility class CommonHosting can wrap the view of the declarative user interface framework into a UI controller UIViewController of the imperative user interface framework and uniformly manage it using the controller UINavigationController, simplifying the navigation logic, reducing the complexity of application code, and improving the application development efficiency. Developers do not need to concern themselves with how the page is implemented by what technology. Page jumps are all completed through a unified navigation interface of the imperative user interface framework. Moreover, the navigation operation of the mixed-coded application interface display method in this application is implemented based on the mature imperative user interface framework controller UINavigationController, fully ensuring the stability and compatibility of navigation and effectively inheriting various mature features of the imperative user interface framework (such as transition animations, gesture returns, etc.), effectively enhancing the user experience.

[0043] As described above, when generating a declarative user interface with a navigation bar in a mixed-coded application, the navigation bar of the imperative user interface framework is shielded, a navigation bar component is created, the first navigation bar is configured through the navigation bar component, the first content view of the declarative user interface framework is passed to the navigation bar component, the first content view is set as a sub-view through the navigation bar component, and the target content view of the navigation bar component is displayed through a view controller that is compatible with the imperative user interface framework. Among them, the target content view includes the view of the first navigation bar and sub-views. By shielding the navigation bar of the imperative user interface framework and combining the display of the navigation bar component and the first content view of the declarative user interface framework, while ensuring the correct display of the navigation bar and the content view, the situation of abnormal interface display caused by the mixed use of different user interface frameworks is reduced, effectively improving the interface display effect of the mixed-coded application.

[0044] Based on the above embodiments, Figure 2 A flowchart of another mixed-coded application interface display method provided by the embodiments of this application is given. This mixed-coded application interface display method is a concretization of the above mixed-coded application interface display method. Refer to Figure 2, the method for displaying the mixed-coded application interface includes:

[0045] S210: When generating a declarative user interface with a navigation bar in a mixed-coded application, shield the navigation bar of the imperative user interface framework, create a navigation bar component, and configure a first navigation bar through the navigation bar component. The mixed-coded application is configured with an imperative user interface framework and a declarative user interface framework.

[0046] In a possible embodiment, the method for displaying the mixed-coded application interface provided by this application to shield the navigation bar of the imperative user interface framework may be: rewrite the properties of the page navigation tool class (navigationController) in the imperative user interface framework through a view controller (RestrictedUIHostingController), so that the page navigation tool class keeps the returned value as a preset value. Wherein, when the value returned by the page navigation tool class is the preset value, the navigation bar of the imperative user interface framework is shielded.

[0047] Exemplarily, rewrite the properties of the page navigation tool class in the imperative user interface framework through a view controller, so that the page navigation tool class keeps the returned value as a preset value. For example, configure the preset value as "nil", and a view controller can be created by inheriting the controller of the imperative user interface framework. Use the view controller to rewrite the properties of the page navigation tool class, so that the page navigation tool class keeps the returned value as nil, and the navigation bar shielding effect is achieved.

[0048] Wherein, when the value returned by the page navigation tool class is the preset value, the navigation bar of the imperative user interface framework is shielded, avoiding navigation bar conflicts under the mixed use of different user interface frameworks and ensuring the consistency and aesthetics of the interface. Among them, the view controller can be used to wrap the content views of each declarative user interface framework in the mixed-coded application.

[0049] It should be explained that when directly using the view controller (UIHostingController) of the imperative user interface framework to wrap the view of the declarative user interface framework, the system default navigation bar may be accidentally displayed. If the declarative user interface framework also implements a navigation bar, it will conflict with the navigation bar of the imperative user interface framework, resulting in a chaotic display of the application interface.

[0050] It should be noted that in the related art, directly using a controller of a declarative user interface framework to wrap a view of the declarative user interface framework may lead to a conflict between the default navigation bar and the navigation bar of the imperative user interface framework. In this application, the properties of the page navigation tool class are rewritten by the view controller so that it always returns a preset value, shielding the system default navigation bar, avoiding user interface conflicts, ensuring the correct display of the application interface, ensuring the consistency and aesthetics of the interface, and improving the user experience.

[0051] S220: Pass the first content view of the declarative user interface framework to the navigation bar component, and set the first content view as a sub-view through the navigation bar component.

[0052] S230: Display the target content view of the navigation bar component through a view controller compatible with the imperative user interface framework. The target content view includes the view of the first navigation bar and the sub-view.

[0053] In a possible embodiment, the method for displaying a hybrid application interface provided by this application is characterized in that after displaying the target content view of the navigation bar component through a view controller compatible with the imperative user interface framework, the environment variables corresponding to the first content view can also be passed to the target content view, so that the target content view inherits the environment variables, reducing the situation that when the first content view is wrapped into a controller (UIHostingController) of the declarative user interface framework and the first content view is opened through the navigation interface of the declarative user interface framework, the environment variables inherited by the first content view are lost, resulting in abnormal display of the application interface.

[0054] In a possible embodiment, the method for displaying a hybrid application interface provided by this application further includes: when generating a declarative user interface without a navigation bar in the hybrid application, shielding the navigation bar of the imperative user interface framework and displaying the second content view of the declarative user interface framework through a view controller compatible with the imperative user interface framework.

[0055] Exemplarily, when the hybrid application needs to generate a declarative user interface without a navigation bar, the navigation bar of the imperative user interface framework can be shielded. For example, the properties of the page navigation tool class in the imperative user interface framework are rewritten by the view controller so that the value returned by the page navigation tool class remains the preset value.

[0056] In one embodiment, after masking the navigation bar of the imperative user interface framework, a second content view displaying the declarative user interface framework can be obtained, and the second content view is displayed through a view controller compatible with the imperative user interface framework, so as to implement the display of the content view of the declarative user interface framework based on the imperative user interface framework. Among them, the second content view may be the same as or different from the first content view. When generating a declarative user interface without a navigation bar in a hybrid application, this application masks the navigation bar of the imperative user interface framework and displays the second content view of the declarative user interface framework through a view controller compatible with the imperative user interface framework. By masking the navigation bar of the imperative user interface framework, while ensuring the correct display of the content view, the situation of abnormal interface display caused by the mixed use of different user interface frameworks is reduced, and the interface display effect of the hybrid application is effectively improved.

[0057] S240: In the case of performing a page back operation in a hybrid application, determine the target class name corresponding to the page back operation, and search for the historical content view corresponding to the target class name in the navigation stack by matching the class name, and return the historical content view for display.

[0058] Exemplarily, when it is detected that a page back operation is performed in a hybrid application, the target class name corresponding to the page back operation can be determined. Optionally, the target class names corresponding to the page back operations performed on different pages can be pre-configured. Among them, the content views displayed by the hybrid application are saved in the navigation stack, and each content view is configured with a corresponding class name. The displayed content views can be extracted from the navigation stack for display to implement the back of the historical page.

[0059] In one embodiment, the historical content view corresponding to the target class name can be searched for in the navigation stack by matching the class name, and the historical content view is returned for display. Optionally, when the historical content view corresponding to the target class name is not found in the navigation stack, the latest added historical content view in the navigation stack can be returned for display, or the historical content view at a preset position in the navigation stack can be returned for display, such as the second historical content view in the navigation stack, to implement the two-level back of the historical page.

[0060] In one embodiment, the page back operation provided by the present application can be implemented through a navigation back tool class (RootNaviTool) that encapsulates navigation operation logic. The navigation back tool class can implement the functions of jumping to the previous N pages and jumping to a page with a specific name under a declarative user interface framework. For example, the navigation back tool class finds the historical content view corresponding to the target class name by matching the class name through the way of jumping pages (such as popToFirstView), and returns the historical content view for display. The present application effectively reduces the situation where the page back under the declarative user interface framework can only go back one page upward by back-displaying the specified historical content view based on class name matching, and realizes flexible navigation page jumping. In one embodiment, before returning the historical content view, the navigation bar of the imperative user interface framework can be blocked again to reduce the accidental appearance of the navigation bar and ensure the normal display of the application interface.

[0061] As described above, when generating a declarative user interface with a navigation bar in a hybrid application, the navigation bar of the imperative user interface framework is blocked, a navigation bar component is created, and the first navigation bar is configured through the navigation bar component. The first content view of the declarative user interface framework is passed to the navigation bar component, and the first content view is set as a sub-view through the navigation bar component. The target content view of the navigation bar component is displayed through a view controller that is compatible with the imperative user interface framework, where the target content view includes the view of the first navigation bar and the sub-view. By blocking the navigation bar of the imperative user interface framework and combining the display of the navigation bar component and the first content view of the declarative user interface framework, while ensuring the correct display of the navigation bar and the content view, the situation of abnormal interface display caused by the mixed use of different user interface frameworks is reduced, and the interface display effect of the hybrid application is effectively improved. It also effectively reduces the situation where the page back under the declarative user interface framework can only go back one page upward by back-displaying the specified historical content view based on class name matching, and realizes flexible navigation page jumping.

[0062] Figure 3 It is a schematic structural diagram of a hybrid application interface display device provided by an embodiment of the present application. Refer to Figure 3 As shown, the hybrid application interface display device includes a shielding processing module 31, a view configuration module 32, and a display processing module 33.

[0063] Among them, the shielding processing module 31 is configured to shield the navigation bar of the imperative user interface framework when generating a declarative user interface with a navigation bar in a hybrid application, create a navigation bar component, and configure the first navigation bar through the navigation bar component. The hybrid application is configured with an imperative user interface framework and a declarative user interface framework; the view configuration module 32 is configured to pass the first content view of the declarative user interface framework to the navigation bar component, and set the first content view as a sub-view through the navigation bar component; the display processing module 33 is configured to display the target content view of the navigation bar component through a view controller compatible with the imperative user interface framework, and the target content view includes the view of the first navigation bar and the sub-view.

[0064] As described above, when generating a declarative user interface with a navigation bar in a hybrid application, the navigation bar of the imperative user interface framework is shielded, a navigation bar component is created, the first navigation bar is configured through the navigation bar component, the first content view of the declarative user interface framework is passed to the navigation bar component, the first content view is set as a sub-view through the navigation bar component, and the target content view of the navigation bar component is displayed through a view controller compatible with the imperative user interface framework. Among them, the target content view includes the view of the first navigation bar and the sub-view. By shielding the navigation bar of the imperative user interface framework and combining the display of the navigation bar component and the first content view of the declarative user interface framework, while ensuring the correct display of the navigation bar and the content view, the situation of abnormal interface display caused by the mixed use of different user interface frameworks is reduced, and the interface display effect of the hybrid application is effectively improved.

[0065] In a possible embodiment, the shielding processing module 31 shields the navigation bar of the imperative user interface framework and is configured to: rewrite the attributes of the page navigation tool class in the imperative user interface framework through the view controller, so that the value returned by the page navigation tool class remains a preset value. Among them, when the value returned by the page navigation tool class is the preset value, the navigation bar of the imperative user interface framework is shielded.

[0066] In a possible embodiment, the shielding processing module 31 is further configured to shield the navigation bar of the imperative user interface framework when generating a declarative user interface without a navigation bar in a hybrid application; the display processing module 33 is further configured to display the second content view of the declarative user interface framework through a view controller compatible with the imperative user interface framework.

[0067] In a possible embodiment, the hybrid application interface display device further includes a page backtracking module, and the page backtracking module is configured to: when performing a page backtracking operation in the hybrid application, determine the target class name corresponding to the page backtracking operation, search for the historical content view corresponding to the target class name in the navigation stack by class name matching, and return the historical content view for display.

[0068] In a possible embodiment, the page rollback module is further configured to block the navigation bar of the imperative user interface framework before returning to the historical content view.

[0069] In a possible embodiment, the hybrid application interface display device further includes an environment transfer module, and the environment transfer module is configured to: transfer the environment variables corresponding to the first content view to the target content view, so that the target content view inherits the environment variables.

[0070] It should be noted that in the embodiments of the above hybrid application interface display device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and are not used to limit the protection scope of the embodiments of the present application.

[0071] The embodiments of the present application further provide a hybrid application interface display device, and the hybrid application interface display device can integrate the hybrid application interface display device provided by the embodiments of the present application. Figure 4 It is a schematic structural diagram of a hybrid application interface display device provided by the embodiments of the present application. Refer to Figure 4 , the hybrid application interface display device includes: an input device 43, an output device 44, a memory 42, and one or more processors 41; the memory 42 is used to store one or more programs; when one or more programs are executed by one or more processors 41, one or more processors 41 implement the hybrid application interface display method provided in the above embodiments. The above provided hybrid application interface display device, device and computer can be used to execute the hybrid application interface display method provided in any of the above embodiments, and have the corresponding functions and beneficial effects.

[0072] The embodiments of the present application further provide a non-volatile storage medium storing computer-executable instructions, and the computer-executable instructions are used to execute the hybrid application interface display method provided in the above embodiments when executed by a computer processor. Of course, for the non-volatile storage medium storing computer-executable instructions provided by the embodiments of the present application, the computer-executable instructions are not limited to the above provided hybrid application interface display method, and can also execute the related operations in the hybrid application interface display method provided in any embodiment of the present application. The hybrid application interface display device, device and storage medium provided in the above embodiments can execute the hybrid application interface display method provided in any embodiment of the present application. For the technical details not described in detail in the above embodiments, reference can be made to the hybrid application interface display method provided in any embodiment of the present application.

[0073] On the basis of the above embodiments, the embodiments of the present application further provide a computer program product. Essentially, or the part that contributes to the prior art, or all or part of the technical solution of the present application can be embodied in the form of a software product. The computer program product is stored in a storage medium and includes several instructions for causing a computer device, a mobile terminal, or a processor therein to execute all or part of the steps of the mixed application interface display method provided in each embodiment of the present application.

Claims

1. A mixed application interface display method, characterized in that: include: In the case of generating a declarative user interface with a navigation bar in a hybrid application, shielding the navigation bar of the imperative user interface framework, creating a navigation bar component, and configuring a first navigation bar through the navigation bar component, wherein the hybrid application is configured with the imperative user interface framework and the declarative user interface framework; Passing the first content view of the declarative user interface framework to the navigation bar component, and setting the first content view as a subview through the navigation bar component; The target content view of the navigation bar component is displayed through a view controller compatible with the imperative user interface framework, and the target content view includes the view of the first navigation bar and the subview.

2. The mixed application interface display method according to claim 1, characterized in that: The navigation bar of the shielding command user interface frame includes: The properties of the page navigation tool class in the imperative user interface framework are rewritten through the view controller so that the page navigation tool class keeps returning a preset value, wherein when the value returned by the page navigation tool class is the preset value, the navigation bar of the imperative user interface framework is blocked.

3. The mixed application interface display method according to claim 1, characterized in that: Also includes: When a declarative user interface without a navigation bar is generated in a hybrid application, the navigation bar of the imperative user interface framework is shielded, and the second content view of the declarative user interface framework is displayed through a view controller compatible with the imperative user interface framework.

4. The mixed application interface display method according to claim 1, characterized in that: After displaying the target content view of the navigation bar component through the view controller compatible with the imperative user interface framework, the method further includes: When a page back operation is performed in the hybrid application, a target class name corresponding to the page back operation is determined, a historical content view corresponding to the target class name is searched in the navigation stack by class name matching, and the historical content view is returned for display.

5. The mixed application interface display method according to claim 4, characterized in that: Before returning to the historical content view, the method further includes: The navigation bar of the imperative user interface frame is shielded.

6. The mixed application interface display method according to claim 1, characterized in that: After displaying the target content view of the navigation bar component through the view controller compatible with the imperative user interface framework, the method further includes: The environment variable corresponding to the first content view is transferred to the target content view, so that the target content view inherits the environment variable.

7. A mixed application interface display device, characterized in that: It includes a shielding processing module, a view configuration module and a display processing module, wherein: The shielding processing module is configured to shield the navigation bar of the imperative user interface framework, create a navigation bar component, and configure the first navigation bar through the navigation bar component when a declarative user interface with a navigation bar is generated in a hybrid application, wherein the hybrid application is configured with an imperative user interface framework and a declarative user interface framework; The view configuration module is configured to transfer the first content view of the declarative user interface framework to the navigation bar component, and set the first content view as a subview through the navigation bar component; The display processing module is configured to display the target content view of the navigation bar component through a view controller compatible with the imperative user interface framework, and the target content view includes the view of the first navigation bar and the subview.

8. A mixed application interface display device, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the mixed application interface display method as described in any one of claims 1-6.

9. A non-volatile storage medium storing computer executable instructions, characterized in that: The computer executable instructions are used to execute the mixed application interface display method as described in any one of claims 1-6 when executed by a computer processor.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the mixed application interface display method described in any one of claims 1 to 6 is implemented.