CN113434143A - iOS application interface layout device and method - Google Patents

iOS application interface layout device and method Download PDF

Info

Publication number
CN113434143A
CN113434143A CN202110780892.1A CN202110780892A CN113434143A CN 113434143 A CN113434143 A CN 113434143A CN 202110780892 A CN202110780892 A CN 202110780892A CN 113434143 A CN113434143 A CN 113434143A
Authority
CN
China
Prior art keywords
layout
description file
page
virtual node
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110780892.1A
Other languages
Chinese (zh)
Inventor
刘飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202110780892.1A priority Critical patent/CN113434143A/en
Publication of CN113434143A publication Critical patent/CN113434143A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention provides an iOS application interface layout device and a method, which can be used in the field of distributed technology, and the device comprises: the page size acquisition module is used for acquiring the size of a target screen through the iOS application before the page is jumped; the dynamic layout module is used for generating a layout description file according to the size of the target screen, wherein the layout description file is used for storing the layout positions of a plurality of components on a target page corresponding to the target screen, and each component corresponds to one element of the page layout; and the dynamic drawing UI module is used for generating a plurality of virtual node trees according to the layout description file and dynamically generating a target page according to the virtual node trees, wherein each virtual node tree corresponds to the layout of one component. The invention can dynamically adapt to different screens.

Description

iOS application interface layout device and method
Technical Field
The invention relates to the field of distributed technology, in particular to an iOS application interface layout device and method.
Background
With the continuous push of new devices by apple companies, apple devices are more and more complicated, screen sizes are more and more, and in the past, a mode of developing a set of UI (user interface) for each screen size in iOS (internet operating system) application is developed, so that the development task is larger and larger, and the development and maintenance of iOS platform application are not facilitated.
Disclosure of Invention
The embodiment of the invention provides an iOS application interface layout device, which is used for dynamically adapting to different screens and comprises the following components:
the page size acquisition module is used for acquiring the size of a target screen through the iOS application before the page is jumped;
the dynamic layout module is used for generating a layout description file according to the size of the target screen, wherein the layout description file is used for storing the layout positions of a plurality of components on a target page corresponding to the target screen, and each component corresponds to one element of the page layout;
and the dynamic drawing UI module is used for generating a plurality of virtual node trees according to the layout description file and dynamically generating a target page according to the virtual node trees, wherein each virtual node tree corresponds to the layout of one component.
The embodiment of the invention provides an iOS application interface layout method, which is used for dynamically adapting to different screens and comprises the following steps:
before the page is skipped, the size of a target screen is obtained through the iOS application;
generating a layout description file according to the size of a target screen, wherein the layout description file is used for storing layout positions of a plurality of components on a target page corresponding to the target screen, and each component corresponds to one element of page layout;
and generating a plurality of virtual node trees according to the layout description file, and dynamically generating a target page according to the plurality of virtual node trees, wherein each virtual node tree corresponds to the layout of one component.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the iOS application interface layout method when executing the computer program.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program for executing the above iOS application interface layout method is stored in the computer-readable storage medium.
In the embodiment of the invention, the page size acquisition module is used for acquiring the size of a target screen through the iOS application before the page is jumped; the dynamic layout module is used for generating a layout description file according to the size of the target screen, wherein the layout description file is used for storing the layout positions of a plurality of components on a target page corresponding to the target screen, and each component corresponds to one element of the page layout; and the dynamic drawing UI module is used for generating a plurality of virtual node trees according to the layout description file and dynamically generating a target page according to the virtual node trees, wherein each virtual node tree corresponds to the layout of one component. In the process, the layout description file is generated according to the size of the target screen, the plurality of virtual node trees are generated, the target page is dynamically generated, dynamic layout is achieved, aiming processing is not needed according to the size of the screen of the device, the device can be continuously used after one-time development, and consistency of the UI on different screen devices is guaranteed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
FIG. 1 is a schematic diagram of an iOS application interface layout apparatus according to an embodiment of the present invention;
FIG. 2 is a diagram of another example of an iOS interface layout apparatus according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for laying out an application interface of an iOS according to an embodiment of the present invention;
FIG. 4 is another flowchart of a method for iOS application interface layout according to an embodiment of the present invention;
FIG. 5 is a diagram of a computer device in an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
In the description of the present specification, the terms "comprising," "including," "having," "containing," and the like are used in an open-ended fashion, i.e., to mean including, but not limited to. Reference to the description of the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," etc., means that a particular feature, structure, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. The sequence of steps involved in the embodiments is for illustrative purposes to illustrate the implementation of the present application, and the sequence of steps is not limited and can be adjusted as needed.
Fig. 1 is a schematic diagram of an iOS application interface layout apparatus according to an embodiment of the present invention, as shown in fig. 1, the apparatus includes:
a screen size obtaining module 101, configured to obtain, before a page is skipped, a size of a target screen through an iOS application;
a dynamic layout module 102, configured to generate a layout description file according to a size of a target screen, where the layout description file is used to store layout positions of multiple components on a target page corresponding to the target screen, where each component corresponds to an element of a page layout;
and the dynamic drawing UI module 103 is configured to generate a plurality of virtual node trees according to the layout description file, and dynamically generate a target page according to the plurality of virtual node trees, where each virtual node tree corresponds to the layout of one component.
In the embodiment of the invention, the layout description file is generated according to the size of the target screen, the plurality of virtual node trees are generated, and the target page is further dynamically generated, so that the dynamic layout is realized, the targeted processing is not required according to the size of the screen of the device, the device can be continuously used after one-time development, and the consistency of the UI interface on different screen devices is ensured.
In one embodiment, the layout description file is described in a description language in the form of JSON.
Fig. 2 is another schematic diagram of an iOS application interface layout apparatus according to an embodiment of the present invention, and in an embodiment, the apparatus further includes a page component update module 104, configured to:
after obtaining a new page layout, splitting the new page layout into a plurality of components, and storing the components in a database, wherein the plurality of components in the layout description file are read from the database.
Of course, the data can be stored in other files besides the database, and all the related variations should fall into the scope of the present invention.
In an embodiment, the dynamic rendering UI module is specifically configured to, including:
constructing a plurality of unordered multi-way trees according to the layout description file;
performing horizontal sequencing on brother nodes in each multi-branch tree;
and generating JSON character strings by adopting a preorder traversal method for each transversely sequenced multi-branch tree to form a virtual node tree.
In summary, in the apparatus provided in the embodiment of the present invention, the page size obtaining module is configured to obtain, before the page is skipped, the size of the target screen through the iOS application; the dynamic layout module is used for generating a layout description file according to the size of the target screen, wherein the layout description file is used for storing the layout positions of a plurality of components on a target page corresponding to the target screen, and each component corresponds to one element of the page layout; and the dynamic drawing UI module is used for generating a plurality of virtual node trees according to the layout description file and dynamically generating a target page according to the virtual node trees, wherein each virtual node tree corresponds to the layout of one component. In the process, the layout description file is generated according to the size of the target screen, the plurality of virtual node trees are generated, the target page is dynamically generated, dynamic layout is achieved, aiming processing is not needed according to the size of the screen of the device, the device can be continuously used after one-time development, and consistency of the UI on different screen devices is guaranteed.
The embodiment of the invention also provides an iOS application interface layout method, the principle of which is similar to that of an iOS application interface layout device, and the details are not repeated here.
Fig. 3 is a flowchart of an iOS application interface layout method in the embodiment of the present invention, as shown in fig. 3, including:
step 301, before jumping to a page, obtaining the size of a target screen through an iOS application;
step 302, generating a layout description file according to the size of the target screen, wherein the layout description file is used for storing layout positions of a plurality of components on a target page corresponding to the target screen, and each component corresponds to one element of page layout;
step 303, generating a plurality of virtual node trees according to the layout description file, and dynamically generating a target page according to the plurality of virtual node trees, wherein each virtual node tree corresponds to the layout of one component.
In one embodiment, the layout description file is described in a description language in the form of JSON.
Fig. 4 is another flowchart of an iOS application interface layout method in an embodiment of the present invention, and in an embodiment, the method further includes:
step 304, after obtaining the new page layout, splitting the new page layout into a plurality of components, and storing the components in the database, wherein the plurality of components in the layout description file are read from the database.
In one embodiment, generating a plurality of virtual node trees from a layout description file includes:
constructing a plurality of unordered multi-way trees according to the layout description file;
performing horizontal sequencing on brother nodes in each multi-branch tree;
and generating JSON character strings by adopting a preorder traversal method for each transversely sequenced multi-branch tree to form a virtual node tree.
In summary, in the method provided in the embodiment of the present invention, before the page is skipped, the size of the target screen is obtained through the iOS application; generating a layout description file according to the size of a target screen, wherein the layout description file is used for storing layout positions of a plurality of components on a target page corresponding to the target screen, and each component corresponds to one element of page layout; and generating a plurality of virtual node trees according to the layout description file, and dynamically generating a target page according to the plurality of virtual node trees, wherein each virtual node tree corresponds to the layout of one component. In the process, the layout description file is generated according to the size of the target screen, the plurality of virtual node trees are generated, the target page is dynamically generated, dynamic layout is achieved, aiming processing is not needed according to the size of the screen of the device, the device can be continuously used after one-time development, and consistency of the UI on different screen devices is guaranteed.
An embodiment of the present invention further provides a computer device, and fig. 5 is a schematic diagram of a computer device in an embodiment of the present invention, where the computer device is capable of implementing all steps in the iOS application interface layout method in the foregoing embodiment, and the computer device specifically includes the following contents:
a processor (processor)501, a memory (memory)502, a communication Interface (Communications Interface)503, and a communication bus 504;
the processor 501, the memory 502 and the communication interface 503 complete mutual communication through the communication bus 504; the communication interface 503 is used for implementing information transmission between related devices such as server-side devices, detection devices, and user-side devices;
the processor 501 is configured to call the computer program in the memory 502, and when the processor executes the computer program, the processor implements all the steps in the iOS application interface layout method in the above embodiments.
An embodiment of the present invention further provides a computer-readable storage medium, which is capable of implementing all steps in the iOS application interface layout method in the above embodiment, wherein the computer-readable storage medium stores thereon a computer program, and when the computer program is executed by a processor, the computer program implements all steps of the iOS application interface layout method in the above embodiment.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. An iOS application interface layout apparatus, comprising:
the screen size acquisition module is used for acquiring the size of a target screen through the iOS application before the page is jumped;
the dynamic layout module is used for generating a layout description file according to the size of the target screen, wherein the layout description file is used for storing the layout positions of a plurality of components on a target page corresponding to the target screen, and each component corresponds to one element of the page layout;
and the dynamic drawing UI module is used for generating a plurality of virtual node trees according to the layout description file and dynamically generating a target page according to the virtual node trees, wherein each virtual node tree corresponds to the layout of one component.
2. The iOS application interface layout apparatus of claim 1, wherein the layout description file is described in a description language in the form of JSON.
3. The iOS application interface layout apparatus of claim 1, further comprising a page component update module to:
after obtaining a new page layout, splitting the new page layout into a plurality of components, and storing the components in a database, wherein the plurality of components in the layout description file are read from the database.
4. The iOS application interface layout apparatus of claim 2, wherein the dynamic rendering UI module is specifically configured to, including:
constructing a plurality of unordered multi-way trees according to the layout description file;
performing horizontal sequencing on brother nodes in each multi-branch tree;
and generating JSON character strings by adopting a preorder traversal method for each transversely sequenced multi-branch tree to form a virtual node tree.
5. An iOS application interface layout method is characterized by comprising the following steps:
before the page is skipped, the size of a target screen is obtained through the iOS application;
generating a layout description file according to the size of a target screen, wherein the layout description file is used for storing layout positions of a plurality of components on a target page corresponding to the target screen, and each component corresponds to one element of page layout;
and generating a plurality of virtual node trees according to the layout description file, and dynamically generating a target page according to the plurality of virtual node trees, wherein each virtual node tree corresponds to the layout of one component.
6. The iOS application interface layout method of claim 5, wherein the layout description file is described in a description language in the form of JSON.
7. The iOS application interface layout method of claim 5, further comprising:
after obtaining a new page layout, splitting the new page layout into a plurality of components, and storing the components in a database, wherein the plurality of components in the layout description file are read from the database.
8. The iOS application interface layout method of claim 6, wherein generating a plurality of virtual node trees from the layout description file comprises:
constructing a plurality of unordered multi-way trees according to the layout description file;
performing horizontal sequencing on brother nodes in each multi-branch tree;
and generating JSON character strings by adopting a preorder traversal method for each transversely sequenced multi-branch tree to form a virtual node tree.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 5 to 8 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 5 to 8.
CN202110780892.1A 2021-07-09 2021-07-09 iOS application interface layout device and method Pending CN113434143A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110780892.1A CN113434143A (en) 2021-07-09 2021-07-09 iOS application interface layout device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110780892.1A CN113434143A (en) 2021-07-09 2021-07-09 iOS application interface layout device and method

Publications (1)

Publication Number Publication Date
CN113434143A true CN113434143A (en) 2021-09-24

Family

ID=77759899

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110780892.1A Pending CN113434143A (en) 2021-07-09 2021-07-09 iOS application interface layout device and method

Country Status (1)

Country Link
CN (1) CN113434143A (en)

Similar Documents

Publication Publication Date Title
CN108279932B (en) Method and device for dynamically configuring user interface of mobile terminal
US10540350B2 (en) Source code search engine
CN108415702B (en) Dynamic rendering method and device for application interface of mobile terminal
CN111209005B (en) Method and apparatus for compiling program file, and computer-readable storage medium
CN110192210A (en) Building and processing are used for the calculating figure of dynamic, structured machine learning model
CN107766052B (en) Method and device for constructing container mirror image
CN111610978B (en) Applet conversion method, device, equipment and storage medium
CN106547527B (en) JavaScript file construction method and device
CN110442330A (en) List element conversion method, device, electronic equipment and storage medium
CN109445827B (en) Game updating method and device, electronic equipment and storage medium
US10303444B2 (en) Composable application session parameters
US11461291B2 (en) Method, electronic device and computer program product for processing machine learning model
CN113742014A (en) Interface rendering method and device, electronic equipment and storage medium
CN108694049B (en) Method and equipment for updating software
Botana et al. A Singular web service for geometric computations
CN113434143A (en) iOS application interface layout device and method
KR101991579B1 (en) Parallel computation method of z-function for order-preserving pattern matching and order-preserving multiple pattern matching
CN105204883B (en) A kind of plug-in unit loading processing method and device
CN110555185A (en) Page customization method and system based on PC client
CN113239328B (en) Service function acquisition method and device, electronic equipment and storage medium
CN113495723B (en) Method, device and storage medium for calling functional component
CN109086362A (en) The management method of multimode project
CN110989982B (en) Building block construction method and device with return value function, storage medium and processor
CN114897664A (en) Graph model deployment method and device, GPU (graphics processing Unit) and storage medium
US20110179087A1 (en) Method for combining and processing web data using tables and programming-by-demonstration

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination