WO2020119435A1 - iOS页面布局方法、终端设备及计算机可读存储介质 - Google Patents
iOS页面布局方法、终端设备及计算机可读存储介质 Download PDFInfo
- Publication number
- WO2020119435A1 WO2020119435A1 PCT/CN2019/120618 CN2019120618W WO2020119435A1 WO 2020119435 A1 WO2020119435 A1 WO 2020119435A1 CN 2019120618 W CN2019120618 W CN 2019120618W WO 2020119435 A1 WO2020119435 A1 WO 2020119435A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- target
- source code
- css
- ios
- layout
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
Definitions
- This application relates to the technical field of software development, in particular to an iOS page layout method, terminal device, and computer-readable storage medium.
- the native layout of the iOS system is to use the system automatic layout such as NSLayoutConstraint and Visual Format Language (Visual Format Language, abbreviation: VFL) and other methods for layout.
- VFL Visual Format Language
- NSLayoutConstraint for layout, even if it is a very simple layout, a lot of code must be written. If the view hierarchy is complex, the amount of code can be imagined, and these codes cannot be reused, resulting in a large workload. The layout efficiency is low.
- VFL is a markup language defined by Apple that describes the relationship between views. It can be used in combination with NSLayoutConstraint.
- the readability of VFL is too poor, which is not conducive to development and debugging.
- the current native layout of the iOS system cannot be reused as a whole, increases code redundancy, and has poor readability, which is not conducive to development and debugging.
- Embodiments of the present application provide an iOS page layout method, terminal device, and computer-readable storage medium, which can reduce code redundancy and enhance readability while implementing iOS page layout, and can reuse code to facilitate development and debugging.
- an embodiment of the present application provides an iOS page layout method, which is applied to a terminal device and includes:
- the CSS source code is converted into iOS layout code, and the iOS layout code includes objective-c code or swift code;
- an embodiment of the present application provides a terminal device.
- the terminal device includes a unit for performing the method of the first aspect.
- an embodiment of the present application provides another terminal device, including a processor and a memory, where the processor and the memory are connected to each other, wherein the memory is used to store a computer program that supports the terminal device to perform the above method.
- the computer program includes program instructions, and the processor is configured to call the program instructions to perform the method of the first aspect.
- the terminal device may further include a user interface and/or a communication interface.
- an embodiment of the present application provides a computer-readable storage medium that stores a computer program, where the computer program includes program instructions, which when executed by a processor causes The processor executes the method of the first aspect described above.
- the computer-readable storage medium may be a computer non-volatile storage medium.
- the embodiments of the present application can implement the native layout of iOS through CSS, so that the code redundancy can be reduced while realizing the layout of the iOS page, and the layout source code can be reused, and the layout source code, that is, the CSS source code, has good readability and is convenient Development and debugging.
- FIG. 1 is a schematic flowchart of an iOS page layout method provided by an embodiment of the present application.
- FIG. 2 is a schematic flowchart of another iOS page layout method provided by an embodiment of the present application.
- FIG. 3 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
- FIG. 4 is a schematic structural diagram of another terminal device provided by an embodiment of the present application.
- the technical solution of the present application may be applied to a terminal device, and the terminal device may be, for example, a mobile phone, a computer, a tablet, a personal computer, a smart watch, etc., which is not limited in this application.
- CSS Cascading Style Sheets
- HTML HyperText Markup Language
- eXtensible Markup Language Extensible Markup Language
- XML Extensible Markup Language
- CSS can not only statically modify web pages, but also dynamically format various elements of web pages with various scripting languages. It supports almost all font size styles, has the ability to edit web page objects and model styles, and has better flexibility. Moreover, CSS can accurately control the layout of element positions on the web page at the pixel level, and has high reliability.
- the CSS and iOS native layout methods are not connected, they are two completely different systems, and the application of the iOS system is developed using Objective-C or Swift language. Therefore, this application can develop (interpret) the CSS source code into objective-c or swift code corresponding to the NSLayoutConstraint used in the iOS native layout by developing a CSS interpreter to translate the CSS description layout to use NSLayoutConstraint and other descriptions Layout. Therefore, the native layout of iOS can be achieved through CSS, without having to care about how to use complex NSLayoutConstraint and other methods for layout, which can reduce code redundancy, and can reuse layout source code, and the layout source code is CSS source code readable Good performance, easy to develop and debug. Each is explained in detail below.
- FIG. 1 is a schematic flowchart of an iOS page layout method provided by an embodiment of the present application. Specifically, the method of this embodiment can be applied to the terminal device described above. As shown in FIG. 1, the iOS page layout method may include the following steps:
- the CSS source code for implementing the layout by determining the target style required by the iOS page, that is, the style (or function, page, etc.) to be laid out.
- the target style may be determined according to the style information input by the user (such as style tags and style description information); or it may be output by outputting each style tag for the user to select, and using the style determined by the style tag selected by the user as The target style; or can also be determined by other means, not listed here one by one.
- the target CSS source code may be input by a user; or, the target CSS source code may also be selected from a preset CSS source code set, for example, selected from the CSS source code set according to the target style information
- the target CSS source code for implementing the target style; or, the target CSS source code can also be selected from the preset CSS source code set corresponding to the CSS source code of the target style, based on the received modification instruction to the CSS
- the source code is determined after modification, such as using the modified CSS source code as the target CSS source code, etc., and this application is not limited.
- the CSS interpreter can be used to convert the input CSS source code into iOS layout code according to the correspondence between the preset CSS source code and iOS layout code.
- the iOS layout code includes objective-c code or swift code or other iOS native layout use Code.
- a CSS interpreter can be developed in advance to convert between CSS source code and iOS layout code.
- the CSS interpreter can be configured with the mapping relationship (or corresponding relationship) between the CSS source code of different layout styles (or functions, pages, etc.) and the iOS layout code (such as objective-c and/or swift code) to achieve Code conversion.
- the mapping relationship can be determined by a large amount of CSS source code and iOS layout code such as objective-c, swift code, etc. For example, it can be obtained by learning and training various styles of CSS source code and corresponding iOS layout code.
- the mapping relationship can also be preset according to the device type of the terminal device, that is, the mapping relationship corresponding to the terminal device of different device types can be different, for example, different layout styles (or functions) can be preset for the PC side , Pages, etc.) between the CSS source code and the iOS layout code, and the mapping relationship between the CSS source code and the iOS layout code preset for the mobile terminal with different layout styles (or functions, pages, etc.), which can be obtained by
- the target device type of the terminal device is transcoded according to the device type and the target CSS source code to obtain a layout page matching the target device type, thereby improving the page layout effect.
- terminal devices of different device types use the same code layout, it is easy to cause problems such as the device page cannot be displayed, and the layout effect is poor; therefore, by configuring different types of CSS source code and iOS layout code for different types of terminal devices The mapping relationship between them can improve the layout reliability and layout effect, and help prevent the problem that the page cannot be displayed.
- the CSS interpreter may also be called other names, such as CSS translator, converter, etc., which is not limited in this application.
- the iOS layout code can be used for iOS page layout to implement the CSS-based iOS page layout.
- the terminal device can obtain the target CSS source code corresponding to the style of the iOS page to be laid out, and convert the target CSS source code into iOS layout code through the configured CSS interpreter to use the iOS layout code for iOS Page layout, so that the native iOS layout can be achieved through CSS, which can reduce the code redundancy while achieving iOS page layout, and can reuse the layout source code, and the layout source code, CSS source code, is more readable and convenient Development and debugging.
- FIG. 2 is a schematic flowchart of another iOS page layout method provided by an embodiment of the present application. Specifically, as shown in FIG. 2, the iOS page layout method may include the following steps:
- the CSS source code set may be pre-configured, and the CSS source code set may include multiple tags and the CSS source code corresponding to each tag.
- the tag may include any one or more of style tags, page tags, function tags, etc., which can be added to the CSS source code according to the corresponding styles, pages, functions, etc. of the CSS source code. CSS source code and its corresponding tags.
- the CSS source code corresponding to each tag may be stored in a CSS file carrying the tag, for example, the CSS source code corresponding to the style tag may be stored in a CSS style file, and the CSS style file carries the style tag.
- the terminal device can determine whether the target CSS source code corresponding to the target style exists in the preset CSS source code set according to the target style tag by determining the style of the iOS page to be laid out, and the target style tag, for example, You can query whether there are tags in the CSS source code set that are the same as the target style tag, such as the same style tag as the target style tag, or the same page tag as the target tag. And when there is a tag that is the same as the tag of the target style, it is determined that there is a target CSS source code corresponding to the target style, that is, a CSS source code corresponding to the same tag, so as to facilitate code conversion based on the target CSS source code to achieve the target Styled iOS page layout.
- the terminal device may output layout prompt information to display multiple style tags for the user to select, and when receiving a user's selection instruction for any of the multiple style tags, the corresponding instruction
- the style corresponding to the tag is determined as the target style required by the iOS page to be laid out
- the CSS source code corresponding to the style tag corresponding to the selection instruction in the CSS source code set is determined as the target CSS source code.
- the terminal device may output a first prompt message to prompt the user to input/write the corresponding code of the target style Target CSS source code; alternatively, the terminal device can also determine the tag with the highest similarity to the target style tag (such as the key of the tag) according to the similarity between each tag in the CSS source code set and the target style tag A label whose word coincidence rate exceeds a preset threshold, or a label with an associated relationship, etc.) corresponding to the CSS source code, and outputs a second prompt message, which may include the CSS corresponding to the label with the highest similarity Source code, so that users can modify the CSS source code corresponding to the tag with the highest similarity to obtain the target CSS source code to quickly determine the layout CSS source code, thereby reducing the development workload of related users such as developers.
- the terminal device may also use the target CSS source code
- the source code and the label of the target style are associated and stored in the CSS source code collection, so as to quickly call the CSS source code later, and realize the reuse of the layout source code.
- the terminal device may also separately preset the CSS source code set according to different device types, so as to quickly determine the CSS source code suitable for the terminal device of the corresponding device type in combination with the device type. Then, when detecting whether the same label as the target style tag exists in the pre-stored CSS source code collection, the terminal device may determine the target device type of the terminal device and select the target device type corresponding to the target device type from a preset database CSS source code collection, the database includes CSS source code collections corresponding to different device types, and each CSS source code collection includes multiple tags and CSS source code corresponding to each tag; and then detects whether the selected CSS source code set exists with the The same label as the target style.
- the preset database includes the CSS source code set corresponding to the PC terminal and the CSS source code set corresponding to the mobile terminal. Assuming that the device type of the terminal device is a mobile terminal device, you can determine whether the The tags with the same target style tags determine whether the CSS source code corresponding to the target style exists in the CSS source code set corresponding to the mobile terminal. Therefore, it helps to avoid the problems of poor display effect and poor page layout effect caused by the same CSS source code for devices of different device types, so as to achieve the reliable display of the same style on different types of devices, and improve the layout reliability and layout effect.
- the CSS source code in the CSS source code set may be a reference CSS source code corresponding to each device type. If there is the same tag as the target style tag, the terminal device may use the CSS source code corresponding to the same tag in the CSS source code set as the reference CSS source code, and determine the target device type of the terminal device, and then determine the target device type according to the target device type The indicated code adjustment rule adjusts the reference CSS source code, and takes the adjusted CSS source code as the target CSS source code corresponding to the target style.
- the adjustment according to the code adjustment rule indicated by the target device type may be adjustment of the attribute value or other value of the reference CSS source code, and the specific value of the adjustment may be preset, for example, the adjustment value may be preset , Style and device type mapping relationship. That is to say, before transcoding, you can also determine the device type of the terminal device that performs page layout, such as PC or mobile, and the reference CSS source code for the style obtained according to different types (such as the CSS source code on the PC side) Or the mobile terminal's CSS source code or other benchmark values) to adjust, and transcode the adjusted CSS through the CSS interpreter to achieve the reliable presentation of the same style on different types of devices.
- the device type of the terminal device that performs page layout such as PC or mobile
- the reference CSS source code for the style obtained according to different types such as the CSS source code on the PC side
- the mobile terminal's CSS source code or other benchmark values to adjust, and transcode the adjusted CSS through the CSS interpreter to achieve the reliable presentation of the same style on different types of devices.
- the width and height on the PC side are both 100 pixels, and the width and height on the mobile side only need 60 pixels.
- the CSS code of the style on the PC side is used as the reference CSS source code, and It is detected that the current page layout is performed on the mobile terminal side, and then the width and height corresponding to the picture can be adjusted from 100 to 60 and then converted by a CSS translator, thereby improving layout reliability and layout effect. Therefore, the corresponding CSS source code can be determined and converted according to the style and device type, so as to realize the iOS page layout based on the CSS.
- the CSS interpreter can be used to convert the input CSS source code into iOS layout code according to the corresponding relationship between the preset CSS source code and the iOS layout code
- the iOS layout code can include an iOS native layout language such as objective-c code or swift code Code.
- the CSS interpreter may be one or more sets (one or more), that is, one or more sets of CSS interpreters may be developed in advance. For example, you can develop an interpreter for converting CSS source code into objective-c code and an interpreter for converting CSS source code into swift code; or develop an interpreter that supports the conversion of CSS source code into objective-c code and swift code Interpreter.
- the CSS interpreter can be developed according to different device types (such as PC, mobile, etc.), for example, the CSS interpreter for the WEB interface of the PC and mobile (such as mobile) can be different.
- this application can select the type of iOS layout code (the development language used) into which the target CSS source code is converted according to different ways (scenarios), for example, the option is to convert the CSS source code into objective-c code, Or convert CSS source code into swift code. Therefore, the flexibility and reliability of transcoding can be improved.
- iOS layout code the development language used
- the terminal device may input the target CSS source code into a pre-configured CSS interpreter; output a prompt message, the prompt message is used to prompt the user to select the target CSS source code into The type of iOS layout code; when a selection instruction input by the user is received, the CSS interpreter is invoked to transcode the target CSS source code according to the type indicated by the selection instruction to obtain the target iOS layout code corresponding to the target CSS source code;
- the type of the target iOS layout code is the same as the type indicated by the selection instruction.
- the terminal device may separately obtain the frequency of use of the terminal device for different types of iOS layout codes in the historical time range, and determine the use of the different types of iOS layout codes
- the type of iOS layout code corresponding to the highest frequency of use input the target CSS source code into a pre-configured CSS interpreter, and call the CSS interpreter to perform the target CSS source code according to the type of iOS layout code corresponding to the highest frequency of use Transform the code to obtain the target iOS layout code corresponding to the target CSS source code; wherein, the type of the target iOS layout code is the same as the type of the iOS layout code corresponding to the highest frequency of use.
- the terminal device when transcoding, can also detect the development language used by the iOS current application, that is, the application that performs iOS page layout, or through big data analysis to determine the most frequently used development of the current application
- the language is converted according to the code corresponding to the development language, such as objective-c code.
- the terminal device may also detect the development language used last time by the terminal device, and perform conversion according to the code corresponding to the development language, such as objective-c code.
- the converted code type may be fixedly set in advance, for example, set to objective-c code, and then convert the CSS source code into objective-c code.
- the period of the converted code type can also be set, such as 1 month, and when the code conversion is performed within the 1 month, the code of the code type obtained by the fixed setting is converted by default.
- the application identifier corresponding to the converted code type can also be set, and then when the application corresponding to the application identifier performs code conversion, the code conversion can be performed according to the set code type.
- the code type can be the same or different.
- the CSS source code set may include CSS source code for H5 page layout.
- the H5 page layout is the CSS layout used, and the layout described by the same set of CSS can be used on different pages. Therefore, the CSS interpreter can also share a set of CSS source code with the H5 page layout, that is, the CSS source code for iOS page layout can be determined from the CSS code for H5 page layout in the terminal device . This helps reduce code redundancy, and can reuse the layout source code, reducing the development workload of developers.
- the iOS page layout after implementing the iOS page layout through the target CSS source code, it can also detect whether a modification instruction is received, so as to adjust the iOS layout according to the modification instruction.
- the modified location information can be used to indicate the location (content) to be modified in the target source code
- the modified content can be used to indicate the modified content of the location to be modified, so as to replace the modified content with the location indicated by the modified location information Content to achieve the modification of the target CSS source code.
- the CSS interpreter can be used to re-transform the modified target CSS source code to adjust or update the layout of the iOS page.
- the terminal device can also detect whether it receives a modification instruction for the CSS source code. If it receives the modification instruction for the CSS source code, the CSS interpreter can also convert the modified CSS source code to objective-c or swift. Code to achieve fast and convenient adjustments to the iOS page layout.
- the terminal device may develop a CSS interpreter, and then, when performing iOS page layout, may obtain the target CSS source code corresponding to the style of the iOS page to be laid out, and use the configured CSS interpreter to apply the target CSS
- the source code is converted into iOS layout code, that is, the CSS-source code is converted into the objective-c or swift code corresponding to the NSLayoutConstraint used in the iOS native layout, so as to translate the layout described by CSS into the layout described by NSLayoutConstraint, etc.
- FIG. 3 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
- the terminal device of the embodiment of the present application includes a unit for performing the above-mentioned iOS page layout method.
- the terminal device 300 of this embodiment may include: an obtaining unit 301, a transcoding unit 302, and a page layout unit 303. among them,
- An obtaining unit 301 configured to determine a target style required for the iOS page to be laid out, and obtain a target CSS source code corresponding to the target style;
- the transcoding unit 302 is used to input the target CSS source code into a pre-configured CSS interpreter to obtain a target iOS layout code corresponding to the target CSS source code, and the CSS interpreter is used to preset CSS source code and iOS layout
- the correspondence of the codes converts the input CSS source code into iOS layout code, and the iOS layout code includes objective-c code or swift code;
- the page layout unit 303 is configured to use the target iOS layout code to lay out the iOS page to obtain a layout page including the target style.
- the acquiring unit 301 may be specifically configured to detect whether a tag in the pre-stored CSS source code set is the same as the target style tag.
- the CSS source code set includes multiple tags and corresponds to each tag CSS source code; if there is the same tag as the target style tag, use the CSS source code corresponding to the same tag in the CSS source code set as the target CSS source code corresponding to the target style.
- the acquiring unit 301 executes the detecting whether the pre-stored CSS source code set has the same tag as the target style tag, it may be specifically used to:
- the database includes CSS source code sets corresponding to different device types, and each CSS source code set includes Multiple tags and CSS source code corresponding to each tag;
- the acquiring unit 301 may be specifically configured to detect whether a tag in the pre-stored CSS source code set is the same as the target style tag.
- the CSS source code set includes multiple tags and corresponds to each tag CSS source code; if there is the same tag as the target style tag, use the CSS source code corresponding to the same tag in the CSS source code set as the reference CSS source code, and determine the target device type of the terminal device;
- the code adjustment rule indicated by the target device type adjusts the reference CSS source code, and uses the adjusted CSS source code as the target CSS source code corresponding to the target style.
- the transcoding unit 302 may be specifically configured to input the target CSS source code into a pre-configured CSS interpreter; output a prompt message, the prompt message is used to prompt the user to select to convert the target CSS source code to The type of the iOS layout code; when receiving the selection instruction input by the user, the CSS interpreter is invoked to transcode the target CSS source code according to the type indicated by the selection instruction to obtain the corresponding Target iOS layout code.
- the type of the target iOS layout code is the same as the type indicated by the selection instruction.
- the transcoding unit 302 may be specifically configured to separately obtain the use frequency of the terminal device for different types of iOS layout codes in the historical time range, and determine the use of the different types of iOS layout codes The type of iOS layout code corresponding to the highest frequency of use; input the target CSS source code into a pre-configured CSS interpreter, and call the CSS interpreter according to the type of iOS layout code corresponding to the highest frequency of use The target CSS source code is transcoded to obtain the target iOS layout code corresponding to the target CSS source code.
- the type of the target iOS layout code is the same as the type of the iOS layout code corresponding to the highest frequency of use.
- the acquiring unit 301 may be further configured to receive a modification instruction for the target CSS source code, where the modification instruction includes modification location information and modification content; use the modification content to replace the target CSS source code. Modify the CSS source code indicated by the location information to obtain the modified target CSS source code;
- the transcoding unit 302 may also be used to input the modified target CSS source code into a pre-configured CSS interpreter to obtain the iOS layout code corresponding to the modified target CSS source code;
- the page layout unit 303 may also be used to lay out the iOS page using the iOS layout code.
- the terminal device may implement some or all of the steps in the iOS page layout method in the embodiments shown in FIG. 1 to FIG. 2 through the above units, and details are not described here. It should be understood that the embodiments of the present application are device embodiments corresponding to the method embodiments, and the description of the method embodiments is also applicable to the embodiments of the present application.
- the terminal device can obtain the target CSS source code corresponding to the style of the iOS page to be laid out, and convert the target CSS source code into iOS layout code through the configured CSS interpreter to use the iOS layout code for iOS Page layout, so that the native iOS layout can be achieved through CSS, which can reduce the code redundancy while achieving iOS page layout, and can reuse the layout source code, and the layout source code, CSS source code, is more readable and convenient Development and debugging.
- FIG. 4 is a schematic structural diagram of another terminal device according to an embodiment of the present application.
- the terminal device is used to execute the aforementioned iOS page layout method.
- the terminal device 400 in this embodiment may include: one or more processors 401 and a memory 402.
- the terminal device may further include one or more user interfaces 403, and/or one or more communication interfaces 404.
- the processor 401, the user interface 403, the communication interface 404, and the memory 402 may be connected through the bus 405, or may be connected in other ways.
- the bus mode is used as an example in FIG.
- the memory 402 is used to store a computer program, and the computer program includes program instructions, and the processor 401 can be used to execute the program instructions stored in the memory 402.
- the processor 401 can be used to call the program instructions to perform the following steps:
- the processor 401 may specifically perform the following steps:
- the CSS source code set includes multiple tags and the CSS source code corresponding to each tag;
- the CSS source code corresponding to the same tag in the CSS source code set is used as the target CSS source code corresponding to the target style.
- the following steps may be specifically performed:
- the database includes CSS source code sets corresponding to different device types, and each CSS source code set includes Multiple tags and CSS source code corresponding to each tag;
- the following steps may be specifically performed:
- the CSS source code set includes multiple tags and the CSS source code corresponding to each tag;
- the following steps may be specifically performed:
- the prompt message is used to prompt the user to select the type of iOS layout code into which the target CSS source code is converted;
- the CSS interpreter When receiving the selection instruction input by the user, the CSS interpreter is called to perform code conversion on the target CSS source code according to the type indicated by the selection instruction to obtain the target iOS layout code corresponding to the target CSS source code; wherein, The type of the target iOS layout code is the same as the type indicated by the selection instruction.
- the following steps may be specifically performed:
- the target iOS layout code corresponding to the source code wherein the type of the target iOS layout code is the same as the type of the iOS layout code corresponding to the highest frequency of use.
- the processor 401 may also be used to perform the following steps:
- the processor 401 may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), application specific integrated circuits (Application Specific Integrated) Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
- the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
- the user interface 403 may include an input device and an output device.
- the input device may include a touch panel, a microphone, and the like
- the output device may include a display (LCD, etc.), a speaker, and the like.
- the communication interface 404 may include a receiver and a transmitter for communicating with other devices.
- the memory 402 may include a read-only memory and a random access memory, and provide instructions and data to the processor 401. A portion of the memory 402 may also include non-volatile random access memory. For example, the memory 402 may also store the aforementioned correspondence between the function pointer and the function, and so on.
- the processor 401 and the like described in the embodiments of the present application can execute the implementation described in the method embodiments shown in FIG. 1 to FIG. 2 above, and can also execute each of the methods described in FIG. 3 of the embodiment of the present application. The implementation of the unit is not repeated here.
- An embodiment of the present application also provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, the computer program can be implemented as described in the embodiments corresponding to FIG. 1 to FIG. 2
- Some or all of the steps in the iOS page layout method may also implement the functions of the terminal device in the embodiment shown in FIG. 3 or FIG. 4 of the present application, and details are not described here.
- Embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, causes the computer to perform some or all of the steps in the above method.
- the computer-readable storage medium may be an internal storage unit of the terminal device described in any of the foregoing embodiments, such as a hard disk or a memory of the terminal device.
- the computer-readable storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk equipped on the terminal device, a smart memory card (Smart, Media, Card, SMC), and a secure digital (SD, Digital, SD) ) Card, flash card (Flash Card), etc.
- the term "and/or” is merely an association relationship that describes an associated object, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, and A and B exist at the same time. There are three cases of B alone.
- the character "/" in this article generally indicates that the related objects before and after are in an "or” relationship.
- the size of the sequence numbers of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
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)
- Stored Programmes (AREA)
Abstract
本申请公开了一种iOS页面布局方法、终端设备及计算机可读存储介质,应用于软件开发技术领域。其中,该方法包括:确定待布局的iOS页面所需的目标样式,并获取所述目标样式对应的目标CSS源码;将所述目标CSS源码输入预先配置的CSS解释器,以得到所述目标CSS源码对应的目标iOS布局代码,所述CSS解释器用于根据预设的CSS源码和iOS布局代码的对应关系将输入的CSS源码转换为iOS布局代码;使用所述目标iOS布局代码对所述iOS页面进行布局,以得到包括所述目标样式的布局页面。采用本申请,能够在实现iOS页面布局的同时降低代码冗余,便于开发和调试。
Description
本申请要求于2018年12月13日提交中国专利局、申请号为201811531560.4、申请名称为“iOS页面布局方法、终端设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及软件开发技术领域,尤其涉及一种iOS页面布局方法、终端设备及计算机可读存储介质。
目前,iOS系统原生布局是使用系统自动布局如NSLayoutConstraint和可视化格式语言(Visual Format Language,缩写:VFL)等方式进行布局。其中,采用NSLayoutConstraint进行布局时,即使进行一个很简单的布局,也要编写大量代码,如果视图层级复杂,代码量可想而知,而且这些代码之间并不能复用,导致工作量较大,布局效率较低。而VFL是苹果公司定义的一种描述视图关系的标记语言,其可以和NSLayoutConstraint结合使用,然而,VFL这种语言的可读性太差,不利于开发和调试。也就是说,目前的iOS系统原生布局方式总体来说无法法复用,增加代码冗余,可读性较差,不利于开发和调试。
发明内容
本申请实施例提供一种iOS页面布局方法、终端设备及计算机可读存储介质,能够在实现iOS页面布局的同时降低代码冗余,增强可读性,且能够复用代码,便于开发和调试。
第一方面,本申请实施例提供了一种iOS页面布局方法,应用于终端设备,包括:
确定待布局的iOS页面所需的目标样式,并获取所述目标样式对应的目标CSS源码;
将所述目标CSS源码输入预先配置的CSS解释器,以得到所述目标CSS源码对应的目标iOS布局代码,所述CSS解释器用于根据预设的CSS源码和iOS布局代码的对应关系将输入的CSS源码转换为iOS布局代码,所述iOS布局代码包括objective-c代码或swift代码;
使用所述目标iOS布局代码对所述iOS页面进行布局,以得到包括所述目标样式的布局页面。
第二方面,本申请实施例提供了一种终端设备,该终端设备包括用于执行 上述第一方面的方法的单元。
第三方面,本申请实施例提供了另一种终端设备,包括处理器和存储器,所述处理器和存储器相互连接,其中,所述存储器用于存储支持终端设备执行上述方法的计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令,执行上述第一方面的方法。可选的,该终端设备还可包括用户接口和/或通信接口。
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行上述第一方面的方法。可选的,该计算机可读存储介质可以为计算机非易失性可读存储介质。
本申请实施例能够通过CSS的方式来实现iOS原生的布局,使得能够在实现iOS页面布局的同时降低代码冗余,并可复用布局源码,且布局源码即CSS源码可读性较好,便于开发和调试。
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图进行介绍。
图1是本申请实施例提供的一种iOS页面布局方法的流程示意图;
图2是本申请实施例提供的另一种iOS页面布局方法的流程示意图;
图3是本申请实施例提供的一种终端设备的结构示意图;
图4是本申请实施例提供的另一种终端设备的结构示意图。
下面将结合本申请实施例中的附图,对本申请实施例的技术方案进行描述。
本申请的技术方案可应用于终端设备中,该终端设备例如可以是手机、电脑、平板、个人计算机、智能手表等,本申请不做限定。
层叠样式表(Cascading Style Sheets,缩写:CSS)是一种描述视图关系的计算机语言,可用于表现超文本标记语言(Hyper Text Markup Language,缩写:HTML)或可扩展标记语言(eXtensible Markup Language,缩写:XML)等文件样式。CSS不仅可以静态地修饰网页,还可以配合各种脚本语言动态地对网页各元素进行格式化,其支持几乎所有的字体字号样式,拥有对网页对象和模型样式编辑的能力,灵活性较好。而且CSS能够对网页中元素位置的排版进行像素级精确控制,可靠性较高。
由于CSS和iOS原生的布局方式是不相通的,其为两个完全不同的体系, iOS系统的应用是使用objective-c或swift语言等进行开发的。因此,本申请可通过开发CSS解释器,将CSS源码转换成(翻译成)iOS原生布局使用的NSLayoutConstraint等方式对应的objective-c或swift代码,以实现将CSS描述的布局翻译为使用NSLayoutConstraint等描述的布局。从而可通过CSS的方式来实现iOS原生的布局,而不必关心怎么使用复杂的NSLayoutConstraint等方式来进行布局,这就可以减少代码冗余,并可复用布局源码,且布局源码即CSS源码可读性较好,便于开发和调试。以下分别详细说明。
请参见图1,图1是本申请实施例提供的一种iOS页面布局方法的流程示意图。具体的,本实施例的方法可应用于上述的终端设备中。如图1所示,该iOS页面布局方法可以包括以下步骤:
101、确定待布局的iOS页面所需的目标样式,并获取该目标样式对应的目标CSS源码。
在需要对某一iOS页面进行布局时,可通过确定该iOS页面所需的目标样式,即待布局的样式(或功能、页面等),来获取用于实现该布局的CSS源码即目标CSS源码。可选的,该目标样式可以是根据用户输入的样式信息(如样式标签、样式描述信息)确定的;或者可以是通过输出各样式标签以供用户选择,将用户选择的样式标签确定的样式作为该目标样式;或者还可以是通过其他方式确定的,此处不一一列举。
进一步可选的,该目标CSS源码可以是用户输入的;或者,该目标CSS源码也可以是从预设的CSS源码集合中选取出的,比如根据该目标样式的信息从该CSS源码集合中选取出的用于实现该目标样式的目标CSS源码;或者,该目标CSS源码也可以是从预设的CSS源码集合中选取出该目标样式对应的CSS源码之后,基于接收到的修改指令对该CSS源码修改后确定的,比如将该修改后的CSS源码作为该目标CSS源码,等等,本申请不做限定。
102、将该目标CSS源码输入预先配置的CSS解释器,以得到该目标CSS源码对应的目标iOS布局代码。
其中,该CSS解释器可用于根据预设的CSS源码和iOS布局代码的对应关系将输入的CSS源码转换为iOS布局代码,该iOS布局代码包括objective-c代码或swift代码或其他iOS原生布局使用的代码。
具体的,本申请可通过预先开发CSS解释器,以实现CSS源码和iOS布局代码之间的转换。其中,该CSS解释器可配置有不同布局样式(或功能、页面等)的CSS源码与iOS布局代码(如objective-c和/或swift代码)的映射关系(或者称为对应关系),以实现代码转换。可选的,该映射关系可通过大量的CSS源码及iOS布局代码如objective-c、swift代码等确定出,比如通过 各种样式的CSS源码及对应的iOS布局代码进行学习训练得到。进一步可选的,该映射关系还可结合终端设备的设备类型分别预置得到,即不同设备类型的终端设备对应的映射关系可以不同,例如,可分别为PC端预置不同布局样式(或功能、页面等)的CSS源码与iOS布局代码之间的映射关系,以及为移动端预置不同布局样式(或功能、页面等)的CSS源码与iOS布局代码之间的映射关系,进而能够通过获取终端设备的目标设备类型,根据该设备类型和该目标CSS源码进行代码转换,以得到与该目标设备类型相匹配的布局页面,从而提升页面布局效果。因不同设备类型的终端设备使用相同的代码布局时容易导致设备页面无法显示等问题,布局效果较差;由此,通过为不同类型的终端设备分别配置不同设备类型的CSS源码和iOS布局代码之间的映射关系,能够提升布局可靠性和布局效果,有助于防止页面无法显示的问题。
可以理解,在其他实施例中,该CSS解释器还可叫做其余名称,比如叫做CSS翻译器、转换器等等,本申请不做限定。
103、使用该目标iOS布局代码对该iOS页面进行布局,以得到包括该目标样式的布局页面。
在通过该CSS解释器转码得到用于实现该目标样式布局的iOS布局代码之后,即可使用该iOS布局代码进行iOS页面布局,以实现基于CSS的iOS页面布局。
在本实施例中,终端设备能够通过获取待布局iOS页面的样式所对应的目标CSS源码,并通过配置的CSS解释器将该目标CSS源码转换为iOS布局代码,以使用该iOS布局代码进行iOS页面布局,从而可通过CSS的方式来实现iOS原生的布局,从而能够在实现iOS页面布局的同时降低代码冗余,并可复用布局源码,且布局源码即CSS源码可读性较好,便于开发和调试。
请参见图2,图2是本申请实施例提供的另一种iOS页面布局方法的流程示意图。具体的,如图2所示,该iOS页面布局方法可以包括以下步骤:
201、确定待布局的iOS页面所需的目标样式,并检测预先存储的CSS源码集合中是否存在与该目标样式的标签相同的标签。
其中,该CSS源码集合可预先配置得到,该CSS源码集合可包括多个标签以及与每一标签对应的CSS源码。可选的,该标签可包括样式标签、页面标签、功能标签等标签中的任一种或多种,即可根据CSS源码对应的各样式、页面、功能等为CSS源码添加标签,得到包括不同CSS源码及其对应标签的CSS源码集合。进一步可选的,每个标签对应的CSS源码可存储于一携带该标签CSS文件中,比如样式标签对应的CSS源码可存储于CSS样式文件中,该CSS样式文件携带有该样式标签。
202、如果存在与该目标样式的标签相同的标签,根据该CSS源码集合中该相同的标签对应的CSS源码确定该目标样式对应的目标CSS源码。
可选的,终端设备可通过确定待布局的iOS页面的样式即目标样式的标签,并根据该目标样式的标签查询预置的CSS源码集合中是否存在该目标样式对应的目标CSS源码,例如,可通过查询该CSS源码集合中是否存在与该目标样式的标签相同的标签,如与该目标样式的样式标签相同的样式标签,又如与该目标样式对应的页面标签相同的页面标签等等。并在存在与该目标样式的标签相同的标签时,确定存在该目标样式对应的目标CSS源码,也即该相同标签对应的CSS源码,以便于基于该目标CSS源码进行代码转换以实现针对该目标样式的iOS页面布局。举例来说,终端设备可输出布局提示信息,以展示多种样式标签以供用户选择,并在接收到用户针对该多种样式标签中的任一标签的选择指令时,将该选择指令对应的标签所对应的样式确定为待布局的iOS页面所需的目标样式,并将该CSS源码集合中该选择指令对应的样式标签所对应的CSS源码确定为该目标CSS源码。以便于根据标签快速查找到对应样式的CSS源码,进而进行代码转换,以实现iOS系统页面布局。
如果该CSS源码集合中不存在与该目标样式的标签相同的标签,即不存在目标样式对应的目标CSS源码时,终端设备可输出第一提示消息,以提示用户输入/编写该目标样式对应的目标CSS源码;或者,可选的,终端设备还可根据CSS源码集合中各标签与该目标样式的标签的相似度,确定出与该目标样式的标签的相似度最高的标签(如标签的关键字的重合率超过预设阈值的标签,或者预先设置有关联关系的标签等等)对应的CSS源码,并输出第二提示消息,该第二提示消息可包括该相似度最高的标签对应的CSS源码,以便于用户在该相似度最高的标签对应的CSS源码的基础上进行修改,得到该目标CSS源码,以快速确定出布局的CSS源码,从而减少了相关用户如开发人员的开发工作量。进一步可选的,终端设备在接收到针对该相似度最高的标签对应的CSS源码的修改指令以得到该目标CSS源码之后,或者在接收到用户输入的目标CSS源码之后,还可将该目标CSS源码及该目标样式的标签关联存储于该CSS源码集合中,以便于后续快速调用该CSS源码,实现布局源码的复用。
进一步可选的,在确定CSS源码集合时,终端设备还可根据不同设备类型分别预置CSS源码集合,以便于结合设备类型快速确定出适用于对应设备类型的终端设备的CSS源码。则在检测预先存储的CSS源码集合中是否存在与该目标样式的标签相同的标签时,终端设备可通过确定该终端设备的目标设备类型,并从预设的数据库中选取与该目标设备类型对应的CSS源码集合, 该数据库包括不同设备类型对应的CSS源码集合,且每个CSS源码集合包括多个标签以及与每一标签对应的CSS源码;进而检测选取的该CSS源码集合中是否存在与该目标样式的标签相同的标签。例如,预设的数据库包括PC端对应的CSS源码集合和移动端对应的CSS源码集合,假设终端设备的设备类型为移动端设备,则可在移动端对应的CSS源码集合中确定是否存在与该目标样式的标签相同的标签,也即确定该移动端对应的CSS源码集合中是否存在该目标样式对应的CSS源码。从而有助于避免因不同设备类型的设备采用相同CSS源码导致显示效果差,页面布局效果不佳的问题,以便于实现相同样式在不同类型的设备的可靠展现,提升布局可靠性和布局效果。
或者,进一步可选的,该CSS源码集合中的CSS源码可以为各设备类型对应的基准CSS源码。如果存在与该目标样式的标签相同的标签,终端设备可以将该CSS源码集合中该相同的标签对应的CSS源码作为基准CSS源码,并确定该终端设备的目标设备类型,进而根据该目标设备类型所指示的代码调整规则对该基准CSS源码进行调整,并将调整后的CSS源码作为该目标样式对应的目标CSS源码。可选的,根据该目标设备类型所指示的代码调整规则进行的调整可以是对该基准CSS源码的属性值或其他值进行调整,调整的具体值可预先设置得到,比如可预先设置得到调整值、样式和设备类型的映射关系。也就是说,在进行代码转换之前,还可以确定进行页面布局的终端设备的设备类型,比如为PC端还是移动端,根据不同的类型对获取的样式的基准CSS源码(比如为PC端的CSS源码或移动端的CSS源码或其他基准值)进行调整,并将调整后的CSS通过CSS解释器进行转码,以实现相同样式在不同类型的设备的可靠展现。举例来说,对于页面中的某一图片,在PC端中的宽和高均为100像素,在移动端的宽和高只需要60像素,如果将PC端的样式的CSS码作为基准CSS源码,且检测到当前是在移动端侧进行页面布局,则可将该图片对应的宽和高由100调整为60以后再通过CSS翻译器进行转换,从而能够提升布局可靠性和布局效果。从而能够根据样式和设备的类型来确定对应的CSS源码进行转换,以基于CSS实现iOS页面布局。
203、将该目标CSS源码输入预先配置的CSS解释器,以得到该目标CSS源码对应的目标iOS布局代码。
其中,该CSS解释器可用于根据预设的CSS源码和iOS布局代码的对应关系将输入的CSS源码转换为iOS布局代码,该iOS布局代码可包括objective-c代码或swift代码等iOS原生布局语言的代码。
可选的,该CSS解释器可以为一套或多套(一个或多个),即可预先开发一套或多套CSS解释器。例如,可分别开发用于将CSS源码转换成 objective-c代码的解释器以及用于将CSS源码转换成swift代码的解释器;或者开发一个均支持将CSS源码转换成objective-c代码和swift代码的解释器。又如,可以根据不同的设备类型(如PC端、移动端等等)来开发CSS解释器,如针对PC端和移动端(如手机端)WEB界面的CSS解释器可以不同。因不同设备类型的终端设备使用相同的CSS源码(样式文件)时容易导致某一类型的设备页面无法显示等问题,适应性较差;由此,通过为不同类型的终端设备分别开发CSS解释器,通过不同的CSS解释器配置不同设备类型的CSS源码和iOS布局代码(如objective-c和/或swift代码)的映射关系,则能够提升布局可靠性和布局效果,有助于防止页面无法显示的问题。
进一步可选的,本申请能够根据不同的方式(场景)来选择将该目标CSS源码转换为的iOS布局代码的类型(使用的开发语言),比如选择是将CSS源码转换成objective-c代码,还是将CSS源码转换成swift代码。从而能够提升代码转换的灵活性和可靠性。
作为一种可能的实施方式,在进行代码转换时,终端设备可将该目标CSS源码输入预先配置的CSS解释器;输出提示消息,该提示消息用于提示用户选择将该目标CSS源码转换为的iOS布局代码的类型;当接收到用户输入的选择指令时,调用该CSS解释器根据该选择指令指示的类型对该目标CSS源码进行代码转换,以得到该目标CSS源码对应的目标iOS布局代码;其中,该目标iOS布局代码的类型与该选择指令指示的类型相同。
作为一种可能的实施方式,在进行代码转换时,终端设备可分别获取该终端设备在历史时间范围内针对不同类型的iOS布局代码的使用频率,并确定出该不同类型的iOS布局代码的使用频率中最高使用频率对应的iOS布局代码的类型;将该目标CSS源码输入预先配置的CSS解释器,并调用该CSS解释器根据该最高使用频率对应的iOS布局代码的类型对该目标CSS源码进行代码转换,以得到该目标CSS源码对应的目标iOS布局代码;其中,该目标iOS布局代码的类型与该最高使用频率对应的iOS布局代码的类型相同。
作为一种可能的实施方式,在进行代码转换时,终端设备还可通过检测iOS当前应用即进行iOS页面布局的应用使用的开发语言,或者通过大数据分析以确定该当前应用使用频率最高的开发语言,根据该开发语言对应的代码如objective-c代码进行转换。
作为一种可能的实施方式,在进行代码转换时,终端设备还可通过检测该终端设备上一次使用的开发语言,根据该开发语言对应的代码如objective-c代码进行转换。
作为一种可能的实施方式,该转换成的代码类型可预先固定设置得到,比 如设置为objective-c代码,进而将CSS源码转换为objective-c代码。可选的,还可设置该转换成的代码类型的周期,如1个月,并可在该1个月内进行代码转换时,均默认转换成该固定设置得到的代码类型的代码。进一步可选的,还可设置该转换成的代码类型对应的应用标识,进而可在该应用标识对应的应用进行代码转换时,按照该设置的代码类型进行代码转换,不同应用进行代码转换时的代码类型可以相同,也可以不同。
可选的,该CSS源码集合可包括用于H5页面布局的CSS源码。目前,H5的页面布局就是使用的CSS布局,且同一套CSS描述的布局可以用在不同的页面上。由此,该CSS解释器还可以和H5的页面布局共用一套CSS源码集合,也即,该用于iOS页面布局的CSS源码可从该终端设备中用于H5页面布局的CSS码中确定出。这就有助于降低代码冗余,并可复用布局源码,降低开发人员开发工作量。
204、使用该目标iOS布局代码对该iOS页面进行布局,以得到包括该目标样式的布局页面。
在进行代码转换得到iOS原生布局使用的iOS布局代码之后,即可使用该目标iOS布局代码对该iOS页面进行布局,以实现通过iOS系统原生的布局方式将该目标样式添加到各个视图上,实现iOS页面布局。
205、接收针对该目标CSS源码的修改指令,该修改指令包括修改位置信息和修改内容。
可选的,在通过该目标CSS源码实现iOS页面布局之后,还可检测是否接收到修改指令,以便于根据该修改指令实现对iOS布局的调整。
206、使用该修改内容替换该目标CSS源码中该修改位置信息指示的CSS源码,以得到修改后的目标CSS源码。
其中,该修改位置信息可用于指示该目标源码中待修改的位置(内容),该修改内容可用于指示该待修改的位置的修改内容,以便于将该修改内容替换该修改位置信息指示的位置的内容,以实现对该目标CSS源码的修改。
207、将该修改后的目标CSS源码输入预先配置的CSS解释器,以得到该修改后的目标CSS源码对应的iOS布局代码,并使用该iOS布局代码对该iOS页面进行布局。
在实现对该目标CSS源码的修改之后,即可通过该CSS解释器重新对该修改后的目标CSS源码进行代码转换,以进行iOS页面布局的调整或更新。也就是说,终端设备还可通过检测是否接收到针对CSS源码的修改指令,如果接收到该CSS源码的修改指令,还可通过该CSS解释器将修改后的CSS源码转换为objective-c或swift代码,以实现对iOS页面布局的快速、便捷调整。
在本实施例中,终端设备可通过开发CSS解释器,进而在进行iOS页面布局时,可通过获取待布局iOS页面的样式所对应的目标CSS源码,并通过配置的CSS解释器将该目标CSS源码转换为iOS布局代码,即实现将CSS源码转换成iOS原生布局使用的NSLayoutConstraint等方式对应的objective-c或swift代码,以实现将CSS描述的布局翻译为使用NSLayoutConstraint等描述的布局,从而可通过编辑CSS源码对应的CSS文件来修改iOS原生的布局,而不必关心怎么使用复杂的NSLayoutConstraint来进行布局,这就可以减少代码冗余,并可复用布局源码,且布局源码即CSS源码可读性较好,便于开发和调试。
上述方法实施例都是对本申请的iOS页面布局方法的举例说明,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
请参见图3,图3是本申请实施例提供的一种终端设备的结构示意图。本申请实施例的终端设备包括用于执行上述iOS页面布局方法的单元。具体的,本实施例的终端设备300可包括:获取单元301、转码单元302和页面布局单元303。其中,
获取单元301,用于确定待布局的iOS页面所需的目标样式,并获取所述目标样式对应的目标CSS源码;
转码单元302,用于将所述目标CSS源码输入预先配置的CSS解释器,以得到所述目标CSS源码对应的目标iOS布局代码,所述CSS解释器用于根据预设的CSS源码和iOS布局代码的对应关系将输入的CSS源码转换为iOS布局代码,所述iOS布局代码包括objective-c代码或swift代码;
页面布局单元303,用于使用所述目标iOS布局代码对所述iOS页面进行布局,以得到包括所述目标样式的布局页面。
可选的,所述获取单元301,可具体用于检测预先存储的CSS源码集合中是否存在与所述目标样式的标签相同的标签,所述CSS源码集合包括多个标签以及与每一标签对应的CSS源码;如果存在与所述目标样式的标签相同的标签,将所述CSS源码集合中所述相同的标签对应的CSS源码作为所述目标样式对应的目标CSS源码。
进一步可选的,所述获取单元301在执行所述检测预先存储的CSS源码集合中是否存在与所述目标样式的标签相同的标签时,可具体用于:
确定所述终端设备的目标设备类型,并从预设的数据库中选取与所述目标设备类型对应的CSS源码集合,所述数据库包括不同设备类型对应的CSS源码集合,且每个CSS源码集合包括多个标签以及与每一标签对应的CSS源码;
检测选取的所述CSS源码集合中是否存在与所述目标样式的标签相同的标签。
可选的,所述获取单元301,可具体用于检测预先存储的CSS源码集合中是否存在与所述目标样式的标签相同的标签,所述CSS源码集合包括多个标签以及与每一标签对应的CSS源码;如果存在与所述目标样式的标签相同的标签,将所述CSS源码集合中所述相同的标签对应的CSS源码作为基准CSS源码,并确定所述终端设备的目标设备类型;根据所述目标设备类型所指示的代码调整规则对所述基准CSS源码进行调整,并将调整后的CSS源码作为所述目标样式对应的目标CSS源码。
可选的,所述转码单元302,可具体用于将所述目标CSS源码输入预先配置的CSS解释器;输出提示消息,所述提示消息用于提示用户选择将所述目标CSS源码转换为的iOS布局代码的类型;当接收到用户输入的选择指令时,调用所述CSS解释器根据所述选择指令指示的类型对所述目标CSS源码进行代码转换,以得到所述目标CSS源码对应的目标iOS布局代码。
其中,所述目标iOS布局代码的类型与所述选择指令指示的类型相同。
可选的,所述转码单元302,可具体用于分别获取所述终端设备在历史时间范围内针对不同类型的iOS布局代码的使用频率,并确定出所述不同类型的iOS布局代码的使用频率中最高使用频率对应的iOS布局代码的类型;将所述目标CSS源码输入预先配置的CSS解释器,并调用所述CSS解释器根据所述最高使用频率对应的iOS布局代码的类型对所述目标CSS源码进行代码转换,以得到所述目标CSS源码对应的目标iOS布局代码。
其中,所述目标iOS布局代码的类型与所述最高使用频率对应的iOS布局代码的类型相同。
可选的,所述获取单元301,还可用于接收针对所述目标CSS源码的修改指令,所述修改指令包括修改位置信息和修改内容;使用所述修改内容替换所述目标CSS源码中所述修改位置信息指示的CSS源码,以得到修改后的目标CSS源码;
所述转码单元302,还可用于将所述修改后的目标CSS源码输入预先配置的CSS解释器,以得到所述修改后的目标CSS源码对应的iOS布局代码;
所述页面布局单元303,还可用于使用所述iOS布局代码对所述iOS页面进行布局。
具体的,该终端设备可通过上述单元实现上述图1至图2所示实施例中的iOS页面布局方法中的部分或全部步骤,此处不赘述。应理解,本申请实施例是对应方法实施例的装置实施例,对方法实施例的描述,也适用于本申请实施 例。
在本实施例中,终端设备能够通过获取待布局iOS页面的样式所对应的目标CSS源码,并通过配置的CSS解释器将该目标CSS源码转换为iOS布局代码,以使用该iOS布局代码进行iOS页面布局,从而可通过CSS的方式来实现iOS原生的布局,从而能够在实现iOS页面布局的同时降低代码冗余,并可复用布局源码,且布局源码即CSS源码可读性较好,便于开发和调试。
请参见图4,图4是本申请实施例提供的另一种终端设备的结构示意图。该终端设备用于执行上述的iOS页面布局方法。如图4所示,本实施例中的终端设备400可以包括:一个或多个处理器401和存储器402。可选的,该终端设备还可包括一个或多个用户接口403,和/或,一个或多个通信接口404。上述处理器401、用户接口403、通信接口404和存储器402可通过总线405连接,或者可以通过其他方式连接,图4中以总线方式进行示例说明。其中,存储器402用于存储计算机程序,所述计算机程序包括程序指令,处理器401可用于执行存储器402存储的程序指令。
其中,处理器401可用于调用所述程序指令执行以下步骤:
确定待布局的iOS页面所需的目标样式,并获取所述目标样式对应的目标CSS源码;将所述目标CSS源码输入预先配置的CSS解释器,以得到所述目标CSS源码对应的目标iOS布局代码,所述CSS解释器用于根据预设的CSS源码和iOS布局代码的对应关系将输入的CSS源码转换为iOS布局代码,所述iOS布局代码包括objective-c代码或swift代码;使用所述目标iOS布局代码对所述iOS页面进行布局,以得到包括所述目标样式的布局页面。
可选的,处理器401在执行所述获取所述目标样式对应的目标CSS源码时,可具体执行以下步骤:
检测预先存储的CSS源码集合中是否存在与所述目标样式的标签相同的标签,所述CSS源码集合包括多个标签以及与每一标签对应的CSS源码;
如果存在与所述目标样式的标签相同的标签,将所述CSS源码集合中所述相同的标签对应的CSS源码作为所述目标样式对应的目标CSS源码。
可选的,所述检测预先存储的CSS源码集合中是否存在与所述目标样式的标签相同的标签时,可具体执行以下步骤:
确定所述终端设备的目标设备类型,并从预设的数据库中选取与所述目标设备类型对应的CSS源码集合,所述数据库包括不同设备类型对应的CSS源码集合,且每个CSS源码集合包括多个标签以及与每一标签对应的CSS源码;
检测选取的所述CSS源码集合中是否存在与所述目标样式的标签相同的标签。
可选的,所述获取所述目标样式对应的目标CSS源码时,可具体执行以下步骤:
检测预先存储的CSS源码集合中是否存在与所述目标样式的标签相同的标签,所述CSS源码集合包括多个标签以及与每一标签对应的CSS源码;
如果存在与所述目标样式的标签相同的标签,将所述CSS源码集合中所述相同的标签对应的CSS源码作为基准CSS源码,并确定所述终端设备的目标设备类型;
根据所述目标设备类型所指示的代码调整规则对所述基准CSS源码进行调整,并将调整后的CSS源码作为所述目标样式对应的目标CSS源码。
可选的,所述将所述目标CSS源码输入预先配置的CSS解释器,以得到所述目标CSS源码对应的目标iOS布局代码时,可具体执行以下步骤:
将所述目标CSS源码输入预先配置的CSS解释器;
调用用户接口403输出提示消息,所述提示消息用于提示用户选择将所述目标CSS源码转换为的iOS布局代码的类型;
当接收到用户输入的选择指令时,调用所述CSS解释器根据所述选择指令指示的类型对所述目标CSS源码进行代码转换,以得到所述目标CSS源码对应的目标iOS布局代码;其中,所述目标iOS布局代码的类型与所述选择指令指示的类型相同。
可选的,所述将所述目标CSS源码输入预先配置的CSS解释器,以得到所述目标CSS源码对应的目标iOS布局代码时,可具体执行以下步骤:
分别获取所述终端设备在历史时间范围内针对不同类型的iOS布局代码的使用频率,并确定出所述不同类型的iOS布局代码的使用频率中最高使用频率对应的iOS布局代码的类型;
将所述目标CSS源码输入预先配置的CSS解释器,并调用所述CSS解释器根据所述最高使用频率对应的iOS布局代码的类型对所述目标CSS源码进行代码转换,以得到所述目标CSS源码对应的目标iOS布局代码;其中,所述目标iOS布局代码的类型与所述最高使用频率对应的iOS布局代码的类型相同。
可选的,处理器401在执行所述使用所述目标iOS布局代码对所述iOS页面进行布局之后,还可用于执行以下步骤:
调用用户接口403接收针对所述目标CSS源码的修改指令,所述修改指令包括修改位置信息和修改内容;
使用所述修改内容替换所述目标CSS源码中所述修改位置信息指示的CSS源码,以得到修改后的目标CSS源码;
将所述修改后的目标CSS源码输入预先配置的CSS解释器,以得到所述修改后的目标CSS源码对应的iOS布局代码,并使用所述iOS布局代码对所述iOS页面进行布局。
其中,所述处理器401可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
用户接口403可包括输入设备和输出设备,输入设备可以包括触控板、麦克风等,输出设备可以包括显示器(LCD等)、扬声器等。
通信接口404可包括接收器和发射器,用于与其他设备进行通信。
存储器402可以包括只读存储器和随机存取存储器,并向处理器401提供指令和数据。存储器402的一部分还可以包括非易失性随机存取存储器。例如,存储器402还可以存储上述的函数指针和函数的对应关系等等。
具体实现中,本申请实施例中所描述的处理器401等可执行上述图1至图2所示的方法实施例中所描述的实现方式,也可执行本申请实施例图3所描述的各单元的实现方式,此处不赘述。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时可实现图1至图2所对应实施例中描述的iOS页面布局方法中的部分或全部步骤,也可实现本申请图3或图4所示实施例的终端设备的功能,此处不赘述。
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述方法中的部分或全部步骤。
所述计算机可读存储介质可以是前述任一实施例所述的终端设备的内部存储单元,例如终端设备的硬盘或内存。所述计算机可读存储介质也可以是所述终端设备的外部存储设备,例如所述终端设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。
在本申请中,术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的 实施过程构成任何限定。
以上所述,仅为本申请的部分实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。
Claims (20)
- 一种iOS页面布局方法,应用于终端设备,其特征在于,包括:确定待布局的iOS页面所需的目标样式,并获取所述目标样式对应的目标层叠样式表CSS源码;将所述目标CSS源码输入预先配置的CSS解释器,以得到所述目标CSS源码对应的目标iOS布局代码,所述CSS解释器用于根据预设的CSS源码和iOS布局代码的对应关系将输入的CSS源码转换为iOS布局代码,所述iOS布局代码包括objective-c代码或swift代码;使用所述目标iOS布局代码对所述iOS页面进行布局,以得到包括所述目标样式的布局页面。
- 根据权利要求1所述的方法,其特征在于,所述获取所述目标样式对应的目标CSS源码,包括:检测预先存储的CSS源码集合中是否存在与所述目标样式的标签相同的标签,所述CSS源码集合包括多个标签以及与每一标签对应的CSS源码;如果存在与所述目标样式的标签相同的标签,将所述CSS源码集合中所述相同的标签对应的CSS源码作为所述目标样式对应的目标CSS源码。
- 根据权利要求2所述的方法,其特征在于,所述检测预先存储的CSS源码集合中是否存在与所述目标样式的标签相同的标签,包括:确定所述终端设备的目标设备类型,并从预设的数据库中选取与所述目标设备类型对应的CSS源码集合,所述数据库包括不同设备类型对应的CSS源码集合,且每个CSS源码集合包括多个标签以及与每一标签对应的CSS源码;检测选取的所述CSS源码集合中是否存在与所述目标样式的标签相同的标签。
- 根据权利要求1所述的方法,其特征在于,所述获取所述目标样式对应的目标CSS源码,包括:检测预先存储的CSS源码集合中是否存在与所述目标样式的标签相同的标签,所述CSS源码集合包括多个标签以及与每一标签对应的CSS源码;如果存在与所述目标样式的标签相同的标签,将所述CSS源码集合中所述相同的标签对应的CSS源码作为基准CSS源码,并确定所述终端设备的目标设备类型;根据所述目标设备类型所指示的代码调整规则对所述基准CSS源码进行调整,并将调整后的CSS源码作为所述目标样式对应的目标CSS源码。
- 根据权利要求1-4任一项所述的方法,其特征在于,所述将所述目标CSS源码输入预先配置的CSS解释器,以得到所述目标CSS源码对应的目标 iOS布局代码,包括:将所述目标CSS源码输入预先配置的CSS解释器;输出提示消息,所述提示消息用于提示用户选择将所述目标CSS源码转换为的iOS布局代码的类型;当接收到用户输入的选择指令时,调用所述CSS解释器根据所述选择指令指示的类型对所述目标CSS源码进行代码转换,以得到所述目标CSS源码对应的目标iOS布局代码;其中,所述目标iOS布局代码的类型与所述选择指令指示的类型相同。
- 根据权利要求1-4任一项所述的方法,其特征在于,所述将所述目标CSS源码输入预先配置的CSS解释器,以得到所述目标CSS源码对应的目标iOS布局代码,包括:分别获取所述终端设备在历史时间范围内针对不同类型的iOS布局代码的使用频率,并确定出所述不同类型的iOS布局代码的使用频率中最高使用频率对应的iOS布局代码的类型;将所述目标CSS源码输入预先配置的CSS解释器,并调用所述CSS解释器根据所述最高使用频率对应的iOS布局代码的类型对所述目标CSS源码进行代码转换,以得到所述目标CSS源码对应的目标iOS布局代码;其中,所述目标iOS布局代码的类型与所述最高使用频率对应的iOS布局代码的类型相同。
- 根据权利要求1-4任一项所述的方法,其特征在于,在所述使用所述目标iOS布局代码对所述iOS页面进行布局之后,所述方法还包括:接收针对所述目标CSS源码的修改指令,所述修改指令包括修改位置信息和修改内容;使用所述修改内容替换所述目标CSS源码中所述修改位置信息指示的CSS源码,以得到修改后的目标CSS源码;将所述修改后的目标CSS源码输入预先配置的CSS解释器,以得到所述修改后的目标CSS源码对应的iOS布局代码,并使用所述iOS布局代码对所述iOS页面进行布局。
- 根据权利要求2-4任一项所述的方法,其特征在于,所述方法还包括:如果所述CSS源码集合中不存在与所述目标样式的标签相同的标签,根据所述CSS源码集合中各标签与所述目标样式的标签的相似度,确定出与所述目标样式的标签的相似度最高的标签对应的CSS源码;输出所述相似度最高的标签对应的CSS源码。
- 一种终端设备,其特征在于,包括:获取单元、转码单元和页面布局 单元;所述获取单元,用于确定待布局的iOS页面所需的目标样式,并获取所述目标样式对应的目标层叠样式表CSS源码;所述转码单元,用于将所述目标CSS源码输入预先配置的CSS解释器,以得到所述目标CSS源码对应的目标iOS布局代码,所述CSS解释器用于根据预设的CSS源码和iOS布局代码的对应关系将输入的CSS源码转换为iOS布局代码,所述iOS布局代码包括objective-c代码或swift代码;所述页面布局单元,用于使用所述目标iOS布局代码对所述iOS页面进行布局,以得到包括所述目标样式的布局页面。
- 根据权利要求9所述的终端设备,其特征在于,所述获取单元,具体用于检测预先存储的CSS源码集合中是否存在与所述目标样式的标签相同的标签,所述CSS源码集合包括多个标签以及与每一标签对应的CSS源码;如果存在与所述目标样式的标签相同的标签,将所述CSS源码集合中所述相同的标签对应的CSS源码作为所述目标样式对应的目标CSS源码。
- 根据权利要求9所述的终端设备,其特征在于,所述获取单元在获取所述目标样式对应的目标CSS源码时,具体用于:检测预先存储的CSS源码集合中是否存在与所述目标样式的标签相同的标签,所述CSS源码集合包括多个标签以及与每一标签对应的CSS源码;如果存在与所述目标样式的标签相同的标签,将所述CSS源码集合中所述相同的标签对应的CSS源码作为基准CSS源码,并确定所述终端设备的目标设备类型;根据所述目标设备类型所指示的代码调整规则对所述基准CSS源码进行调整,并将调整后的CSS源码作为所述目标样式对应的目标CSS源码。
- 根据权利要求9-11任一项所述的终端设备,其特征在于,所述转码单元,具体用于将所述目标CSS源码输入预先配置的CSS解释器;输出提示消息,所述提示消息用于提示用户选择将所述目标CSS源码转换为的iOS布局代码的类型;当接收到用户输入的选择指令时,调用所述CSS解释器根据所述选择指令指示的类型对所述目标CSS源码进行代码转换,以得到所述目标CSS源码对应的目标iOS布局代码;其中,所述目标iOS布局代码的类型与所述选择指令指示的类型相同。
- 根据权利要求9-11任一项所述的终端设备,其特征在于,所述转码单元,具体用于分别获取所述终端设备在历史时间范围内针对不同类型的iOS布局代码的使用频率,并确定出所述不同类型的iOS布局代码的 使用频率中最高使用频率对应的iOS布局代码的类型;将所述目标CSS源码输入预先配置的CSS解释器,并调用所述CSS解释器根据所述最高使用频率对应的iOS布局代码的类型对所述目标CSS源码进行代码转换,以得到所述目标CSS源码对应的目标iOS布局代码;其中,所述目标iOS布局代码的类型与所述最高使用频率对应的iOS布局代码的类型相同。
- 根据权利要求9-11任一项所述的终端设备,其特征在于,所述获取单元,还用于接收针对所述目标CSS源码的修改指令,所述修改指令包括修改位置信息和修改内容;使用所述修改内容替换所述目标CSS源码中所述修改位置信息指示的CSS源码,以得到修改后的目标CSS源码;所述转码单元,还用于将所述修改后的目标CSS源码输入预先配置的CSS解释器,以得到所述修改后的目标CSS源码对应的iOS布局代码,并使用所述iOS布局代码对所述iOS页面进行布局。
- 根据权利要求10或11所述的终端设备,其特征在于,所述获取单元,还用于当所述CSS源码集合中不存在与所述目标样式的标签相同的标签时,根据所述CSS源码集合中各标签与所述目标样式的标签的相似度,确定出与所述目标样式的标签的相似度最高的标签对应的CSS源码;所述转码单元,还用于输出所述相似度最高的标签对应的CSS源码。
- 一种终端设备,其特征在于,包括处理器和存储器,所述处理器和存储器相互连接,其中,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令,执行以下步骤:确定待布局的iOS页面所需的目标样式,并获取所述目标样式对应的目标层叠样式表CSS源码;将所述目标CSS源码输入预先配置的CSS解释器,以得到所述目标CSS源码对应的目标iOS布局代码,所述CSS解释器用于根据预设的CSS源码和iOS布局代码的对应关系将输入的CSS源码转换为iOS布局代码,所述iOS布局代码包括objective-c代码或swift代码;使用所述目标iOS布局代码对所述iOS页面进行布局,以得到包括所述目标样式的布局页面。
- 根据权利要求16所述的终端设备,其特征在于,所述处理器在执行所述获取所述目标样式对应的目标CSS源码时,具体执行以下步骤:检测预先存储的CSS源码集合中是否存在与所述目标样式的标签相同的标签,所述CSS源码集合包括多个标签以及与每一标签对应的CSS源码;如果存在与所述目标样式的标签相同的标签,将所述CSS源码集合中所 述相同的标签对应的CSS源码作为所述目标样式对应的目标CSS源码。
- 根据权利要求16所述的终端设备,其特征在于,所述处理器在执行所述获取所述目标样式对应的目标CSS源码时,具体执行以下步骤:检测预先存储的CSS源码集合中是否存在与所述目标样式的标签相同的标签,所述CSS源码集合包括多个标签以及与每一标签对应的CSS源码;如果存在与所述目标样式的标签相同的标签,将所述CSS源码集合中所述相同的标签对应的CSS源码作为基准CSS源码,并确定所述终端设备的目标设备类型;根据所述目标设备类型所指示的代码调整规则对所述基准CSS源码进行调整,并将调整后的CSS源码作为所述目标样式对应的目标CSS源码。
- 根据权利要求16-18任一项所述的终端设备,其特征在于,所述处理器在执行所述将所述目标CSS源码输入预先配置的CSS解释器,以得到所述目标CSS源码对应的目标iOS布局代码时,具体执行以下步骤:分别获取所述终端设备在历史时间范围内针对不同类型的iOS布局代码的使用频率,并确定出所述不同类型的iOS布局代码的使用频率中最高使用频率对应的iOS布局代码的类型;将所述目标CSS源码输入预先配置的CSS解释器,并调用所述CSS解释器根据所述最高使用频率对应的iOS布局代码的类型对所述目标CSS源码进行代码转换,以得到所述目标CSS源码对应的目标iOS布局代码;其中,所述目标iOS布局代码的类型与所述最高使用频率对应的iOS布局代码的类型相同。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行如权利要求1-8任一项所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811531560.4 | 2018-12-13 | ||
| CN201811531560.4A CN109799988B (zh) | 2018-12-13 | 2018-12-13 | iOS页面布局方法、终端设备及计算机可读存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020119435A1 true WO2020119435A1 (zh) | 2020-06-18 |
Family
ID=66556745
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/120618 Ceased WO2020119435A1 (zh) | 2018-12-13 | 2019-11-25 | iOS页面布局方法、终端设备及计算机可读存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN109799988B (zh) |
| WO (1) | WO2020119435A1 (zh) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112035108A (zh) * | 2020-08-28 | 2020-12-04 | 沈阳欧瑞科技有限公司 | 一种用户界面布局设计方法、系统、终端及介质 |
| CN113094040A (zh) * | 2021-03-08 | 2021-07-09 | 南京唯优信息技术有限公司 | 一种小程序编译方法和装置 |
| CN113391806A (zh) * | 2021-06-25 | 2021-09-14 | 北京光启元数字科技有限公司 | 一种将颜色代码进行转换的方法、装置、设备和可读介质 |
| CN113868565A (zh) * | 2021-09-23 | 2021-12-31 | 深圳市腾讯网域计算机网络有限公司 | 皮肤样式的文件编辑方法及装置 |
| CN115061686A (zh) * | 2022-06-30 | 2022-09-16 | 平安银行股份有限公司 | 一种基于用户标签的页面展示方法、装置及电子设备 |
| CN117332169A (zh) * | 2023-09-27 | 2024-01-02 | 京东科技信息技术有限公司 | 页面样式更新方法和装置 |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109799988B (zh) * | 2018-12-13 | 2022-03-15 | 深圳壹账通智能科技有限公司 | iOS页面布局方法、终端设备及计算机可读存储介质 |
| CN110569034A (zh) * | 2019-08-27 | 2019-12-13 | 上海易点时空网络有限公司 | 界面开发的方法及装置 |
| CN111859212B (zh) * | 2020-05-11 | 2024-12-10 | 马上消费金融股份有限公司 | 一种获取页面的方法、终端设备及存储介质 |
| CN115878237B (zh) * | 2021-09-28 | 2026-01-09 | 华为技术有限公司 | 一种界面布局的配置和显示方法和电子设备 |
| CN114491346A (zh) * | 2022-02-07 | 2022-05-13 | 阿里巴巴(中国)有限公司 | 更改显示区域方法、设备、存储介质及计算机程序产品 |
Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20050198577A1 (en) * | 2004-03-05 | 2005-09-08 | International Business Machines Corporation | Reducing the run-time cost of incorporating custom tags in a server page |
| CN106293645A (zh) * | 2015-05-13 | 2017-01-04 | Tcl集团股份有限公司 | 一种提高Web应用界面渲染效率的方法及系统 |
| CN106897055A (zh) * | 2017-01-10 | 2017-06-27 | 深圳市赛亿科技开发有限公司 | 一种兼容pc端和手机端web界面的实现方法 |
| CN107169007A (zh) * | 2017-03-31 | 2017-09-15 | 北京奇艺世纪科技有限公司 | 一种移动终端的显示界面设置方法及装置 |
| US20170286073A1 (en) * | 2016-03-31 | 2017-10-05 | Tmaxsoft. Co., Ltd. | Apparatus for providing framework to develop client application executed on multiple platforms, and method using the same |
| CN107463383A (zh) * | 2017-08-16 | 2017-12-12 | 四川长虹电器股份有限公司 | 一种HybridAPP中CSS样式兼容不同平台的方法及系统 |
| CN107632833A (zh) * | 2017-07-31 | 2018-01-26 | 广州神马移动信息科技有限公司 | 轻应用的生成方法、设备及电子设备 |
| CN108595447A (zh) * | 2016-12-13 | 2018-09-28 | 广州市动景计算机科技有限公司 | 用户终端及网页页面特性分析装置与方法 |
| CN108628900A (zh) * | 2017-03-23 | 2018-10-09 | 腾讯科技(深圳)有限公司 | 一种数据格式获取的方法以及相关装置 |
| CN109799988A (zh) * | 2018-12-13 | 2019-05-24 | 深圳壹账通智能科技有限公司 | iOS页面布局方法、终端设备及计算机可读存储介质 |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107943477A (zh) * | 2017-11-22 | 2018-04-20 | 北京酷我科技有限公司 | 一种iOS上通过XML实现UI布局的方法 |
-
2018
- 2018-12-13 CN CN201811531560.4A patent/CN109799988B/zh not_active Expired - Fee Related
-
2019
- 2019-11-25 WO PCT/CN2019/120618 patent/WO2020119435A1/zh not_active Ceased
Patent Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20050198577A1 (en) * | 2004-03-05 | 2005-09-08 | International Business Machines Corporation | Reducing the run-time cost of incorporating custom tags in a server page |
| CN106293645A (zh) * | 2015-05-13 | 2017-01-04 | Tcl集团股份有限公司 | 一种提高Web应用界面渲染效率的方法及系统 |
| US20170286073A1 (en) * | 2016-03-31 | 2017-10-05 | Tmaxsoft. Co., Ltd. | Apparatus for providing framework to develop client application executed on multiple platforms, and method using the same |
| CN108595447A (zh) * | 2016-12-13 | 2018-09-28 | 广州市动景计算机科技有限公司 | 用户终端及网页页面特性分析装置与方法 |
| CN106897055A (zh) * | 2017-01-10 | 2017-06-27 | 深圳市赛亿科技开发有限公司 | 一种兼容pc端和手机端web界面的实现方法 |
| CN108628900A (zh) * | 2017-03-23 | 2018-10-09 | 腾讯科技(深圳)有限公司 | 一种数据格式获取的方法以及相关装置 |
| CN107169007A (zh) * | 2017-03-31 | 2017-09-15 | 北京奇艺世纪科技有限公司 | 一种移动终端的显示界面设置方法及装置 |
| CN107632833A (zh) * | 2017-07-31 | 2018-01-26 | 广州神马移动信息科技有限公司 | 轻应用的生成方法、设备及电子设备 |
| CN107463383A (zh) * | 2017-08-16 | 2017-12-12 | 四川长虹电器股份有限公司 | 一种HybridAPP中CSS样式兼容不同平台的方法及系统 |
| CN109799988A (zh) * | 2018-12-13 | 2019-05-24 | 深圳壹账通智能科技有限公司 | iOS页面布局方法、终端设备及计算机可读存储介质 |
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112035108A (zh) * | 2020-08-28 | 2020-12-04 | 沈阳欧瑞科技有限公司 | 一种用户界面布局设计方法、系统、终端及介质 |
| CN112035108B (zh) * | 2020-08-28 | 2024-05-17 | 沈阳欧瑞科技有限公司 | 一种用户界面布局设计方法、系统、终端及介质 |
| CN113094040A (zh) * | 2021-03-08 | 2021-07-09 | 南京唯优信息技术有限公司 | 一种小程序编译方法和装置 |
| CN113391806A (zh) * | 2021-06-25 | 2021-09-14 | 北京光启元数字科技有限公司 | 一种将颜色代码进行转换的方法、装置、设备和可读介质 |
| CN113868565A (zh) * | 2021-09-23 | 2021-12-31 | 深圳市腾讯网域计算机网络有限公司 | 皮肤样式的文件编辑方法及装置 |
| CN113868565B (zh) * | 2021-09-23 | 2024-05-24 | 深圳市腾讯网域计算机网络有限公司 | 皮肤样式的文件编辑方法及装置 |
| CN115061686A (zh) * | 2022-06-30 | 2022-09-16 | 平安银行股份有限公司 | 一种基于用户标签的页面展示方法、装置及电子设备 |
| CN117332169A (zh) * | 2023-09-27 | 2024-01-02 | 京东科技信息技术有限公司 | 页面样式更新方法和装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109799988B (zh) | 2022-03-15 |
| CN109799988A (zh) | 2019-05-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020119435A1 (zh) | iOS页面布局方法、终端设备及计算机可读存储介质 | |
| CN110347953B (zh) | 页面生成方法、装置、计算机设备及存储介质 | |
| WO2020048326A1 (zh) | 一种界面显示方法、系统及终端设备 | |
| CN105653254A (zh) | 原生界面适配方法、装置及应用其的电子设备 | |
| US10600221B2 (en) | System, method, and electronic device for information duplication and machine-readable storage medium | |
| EP3416054B1 (en) | Method and device for page display, and storage medium | |
| CN113778582B (zh) | 本地化多语言适配的设置方法、装置、设备及存储介质 | |
| CN106339405A (zh) | 用于显示网络内容的方法和支持其的电子装置 | |
| US20160110207A1 (en) | Methods for copying information handling system configuration settings | |
| CN113031946A (zh) | 一种渲染页面组件的方法和装置 | |
| CN113094138B (zh) | 界面显示方法、装置、电子设备及存储介质 | |
| CN113568621B (zh) | 一种页面埋点的数据处理方法和装置 | |
| CN109800161A (zh) | 一种用户界面的控件测试方法、电子设备和可存储介质 | |
| US10282174B2 (en) | Software layout processing localization | |
| WO2019136964A1 (zh) | 一种文本选中方法及终端 | |
| CN113391808B (zh) | 页面的配置方法、装置及电子设备 | |
| CN109814778B (zh) | 小程序选项卡的实现方法、装置、电子设备及介质 | |
| CN114691712A (zh) | 一种生成票据的方法、装置以及存储介质 | |
| CN116579275A (zh) | 系统级芯片的设计方法、系统、电子设备及存储介质 | |
| US20200034101A1 (en) | Data displaying method and electronic device | |
| US11853685B2 (en) | Transformation of resource files using mapped keys for tracking content location | |
| US20260004051A1 (en) | Page rendering method, device, and storage medium | |
| WO2020131500A1 (en) | Customizable user interface for use with digital ink | |
| CN116483492A (zh) | 移动设备分辨率适配方法、装置、电子设备及存储介质 | |
| WO2023245375A1 (zh) | wasm快应用框架数据绑定方法和装置、电子设备、存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19894895 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 29.09.2021) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19894895 Country of ref document: EP Kind code of ref document: A1 |