WO2019071928A1 - Method and apparatus for implementing list view, and readable storage medium and device - Google Patents

Method and apparatus for implementing list view, and readable storage medium and device Download PDF

Info

Publication number
WO2019071928A1
WO2019071928A1 PCT/CN2018/082342 CN2018082342W WO2019071928A1 WO 2019071928 A1 WO2019071928 A1 WO 2019071928A1 CN 2018082342 W CN2018082342 W CN 2018082342W WO 2019071928 A1 WO2019071928 A1 WO 2019071928A1
Authority
WO
WIPO (PCT)
Prior art keywords
class
view
module
rnsmartcollectionview
create
Prior art date
Application number
PCT/CN2018/082342
Other languages
French (fr)
Chinese (zh)
Inventor
黄露洋
张文明
陈少杰
Original Assignee
武汉斗鱼网络科技有限公司
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 武汉斗鱼网络科技有限公司 filed Critical 武汉斗鱼网络科技有限公司
Publication of WO2019071928A1 publication Critical patent/WO2019071928A1/en

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/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • 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

Definitions

  • a first creating unit configured to create an RNSmartCollectionViewCell class for characterizing a cell shell view in the list view, and bridging the RNSmartCollectionViewCell class with the JS module;
  • a second creating unit configured to create an RNSmartCollectionView class for carrying the list view, and bridging the RNSmartCollectionView class with the JS module, where the template and the paragraph attribute are maintained in the RNSmartCollectionView class, where the template is The attribute is used to store a template view registered to the RNSmartCollectionView class, where the paragraph attribute is used to store the data source of the RNSmartCollectionView class;
  • the third creation unit is used to create the RNSmartCollectionTemplateView class.
  • the RN set view class is created, and the RN set view class is bridged with the JS module developed by the JS language, and the RN set view class inherits from the UICollectionView;
  • FIG. 2 is a structural diagram of an apparatus for implementing a list view in an embodiment of the present invention
  • FIG. 3 is a schematic diagram showing the physical structure of a computer device in an embodiment of the present invention.
  • Step 101 In the OC module, create an RN set view class, and bridge the RN set view class with the JS module, and the RN set view class inherits from the UICollectionView.
  • Step 102 The RN set view class is invoked by using the JS module to create an instance of the RN set view class.
  • the RN set view class is created and the RN set view class is bridged with the JS module, including:
  • the RNSmartCollectionView class maintains templates and sections properties.
  • the template properties are used to store the template view registered to the RNSmartCollectionView class.
  • the paragraph attribute is used to store the data source of the RNSmartCollectionView class.
  • the UIView is created to inherit the RNSmartCollectionView class.
  • the RNSmartCollectionView class is internally created with a UICollectionView.
  • the UICollectionView is added as a subview of the RNSmartCollectionView class in the view hierarchy of the RNSmartCollectionView class, and provides a data source for the UICollectionView.
  • the template information corresponding to the template attribute is constructed.
  • the Cell label provided by the RN SmartCollectionViewCell class of the OC end bridged with the JS module can be provided to the Cell label by writing an ordinary HTML page.
  • Various subtags are used to implement custom style views, and these template views are assigned to reuse identifiers and then stored in the templates dictionary.
  • constructing section information corresponding to the paragraph attribute specifically, processing the data source to be displayed in the list, adding the reuse identifier and the template information.
  • create an instance of the RNSmartCollectionView class and pass the template information and paragraph information to the instance of the RNSmartCollectionView class.
  • an embodiment of the present invention further provides a device for implementing a list view. As shown in FIG. 2, the device includes:
  • the third creation unit is used to create the RNSmartCollectionTemplateView class.
  • UIView Inheriting the UIView to create the RNSmartCollectionView class, wherein the RNSmartCollectionView class is internally created with a UICollectionView, and the UICollectionView is added as a child view of the RNSmartCollectionView class in the view hierarchy of the RNSmartCollectionView class.
  • a fourth creating unit configured to create an instance of the RNSmartCollectionView class
  • An incoming unit configured to pass the template information and the paragraph information into an instance of the RNSmartCollectionView class.
  • the RN set view class is invoked by the JS module to create an instance of the RN set view class.
  • the embodiment of the present invention further provides a computer device.
  • a computer device As shown in FIG. 3, for the convenience of description, only parts related to the embodiment of the present invention are shown. If the specific technical details are not disclosed, please refer to the method part of the embodiment of the present invention.
  • the computer device may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), an in-vehicle computer, and the like, and the computer device is used as a mobile phone as an example:
  • FIG. 3 is a block diagram showing a portion of the structure associated with a computer device provided by an embodiment of the present invention.
  • the computer device includes a memory 301 and a processor 302.
  • the computer device architecture illustrated in Figure 3 does not constitute a limitation to a computer device, and may include more or fewer components than those illustrated, or a combination of certain components, or different component arrangements.
  • the memory 301 can be used to store software programs and modules, and the processor 302 executes various functional applications and data processing by running software programs and modules stored in the memory 301.
  • the memory 301 can mainly include a storage program area and a storage data area, wherein the storage program area can store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area can store data. (such as audio data, phone book, etc.).
  • the memory 301 may include a high speed random access memory, and may also include a nonvolatile memory such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the processor 302 is a control center of a computer device that performs various functions and processing data by running or executing software programs and/or modules stored in the memory 301, and recalling data stored in the memory 301.
  • the processor 302 may include one or more processing units; preferably, the processor 302 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
  • the modem processor primarily handles wireless communications.
  • the processor 302 included in the computer device may have the following functions:
  • the RN set view class is created, and the RN set view class is bridged with the JS module developed by the JS language, and the RN set view class inherits from the UICollectionView;
  • the RN set view class is invoked by the JS module to create an instance of the RN set view class.
  • the present application uses the OC module to create an RN set view class, and bridges the RN set view class with a JS module developed using the JS language.
  • the RN set view class inherits from the UICollectionView, and then uses the JS module to call the RN set view class to create an RN.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
  • Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some, or all, of the gateways, proxy servers, systems in accordance with embodiments of the present invention.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

A method and apparatus for implementing a list view involved in software development, and a readable storage medium and a device. The method comprises: in an OC module developed by using an OC language, creating an RN set view class, and bridging the RN set view class with a JS module developed by using a JS language, wherein the RN set view class inherits UICollectionView (101); and using the JS module to invoke the RN set view class, and creating an instance of the RN set view class (102). Since UICollectionView, which has a reuse mechanism, is utilized for bridging, in the implementation process of introducing the reuse mechanism to a list view, the performance of an infinite sliding list is improved; and with regard to the infinite sliding list, the consumption of resources can be reduced both in terms of a memory and in terms of computation resources, avoiding same being killed by a system due to occupying an excessive amount of memory.

Description

列表视图的实现方法、装置、可读存储介质及设备List view implementation method, device, readable storage medium and device 技术领域Technical field
本发明涉及软件开发技术领域,尤其涉及列表视图的实现方法、装置、可读存储介质及设备。The present invention relates to the field of software development technologies, and in particular, to a method, an apparatus, a readable storage medium, and a device for implementing a list view.
背景技术Background technique
随着Facebook开源的ReactNative(RN)框架的流行,越来越多的移动开发团队开始使用其进行应用程序开发。利用RN框架,开发人员可以开发出能够同时在iOS系统和Android系统中运行的应用程序,同时,还可以通过JavaScript(JS)动态创建任意样式的原生视图,即,可以通过服务器下发JS代码,JS代码在执行时创建指定样式的原生视图。With the popularity of Facebook's open source ReactNative (RN) framework, more and more mobile development teams are using it for application development. With the RN framework, developers can develop applications that run on both the iOS and Android systems, as well as dynamically create native views of any style via JavaScript (JS), ie, JS code can be delivered via the server. The JS code creates a native view of the specified style when executed.
然而,利用ReactNative框架在iOS系统下进行应用程序的开发时,存在以下问题:iOS系统内置的列表视图控件(ListView)在无限滑动列表场景下,当滚动列表达到一定规模时,应用程序将会因占用内存过高而被系统杀死。However, when using the ReactNative framework to develop applications under iOS, the following problems exist: The list view control (ListView) built into the iOS system is in an infinite sliding list scenario. When the scrolling list reaches a certain size, the application will be The memory is too high and is killed by the system.
发明内容Summary of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的列表视图的实现方法、装置、可读存储介质及设备。In view of the above problems, the present invention has been made in order to provide an implementation method, apparatus, readable storage medium and apparatus for a list view that overcomes the above problems or at least partially solves the above problems.
本发明实施例提供一种列表视图的实现方法,所述方法包括:An embodiment of the present invention provides a method for implementing a list view, where the method includes:
在利用OC语言开发的OC模块中,创建RN集合视图类,并将所述RN集合视图类与利用JS语言开发的JS模块进行桥接,所述RN集合视图类继承于UICollectionView;In the OC module developed by using the OC language, the RN set view class is created, and the RN set view class is bridged with the JS module developed by the JS language, and the RN set view class inherits from the UICollectionView;
利用所述JS模块调用所述RN集合视图类,创建所述RN集合视图类的实例。The RN set view class is invoked by the JS module to create an instance of the RN set view class.
优选的,所述创建RN集合视图类,并将所述RN集合视图类与利用JS语言开发的JS模块进行桥接,包括:Preferably, the RN set view class is created, and the RN set view class is bridged with a JS module developed by using a JS language, including:
创建用于表征列表视图中单元壳视图的RNSmartCollectionViewCell类,并将所述RNSmartCollectionViewCell类与所述JS模块桥接;Creating an RNSmartCollectionViewCell class for characterizing a cell shell view in the list view, and bridging the RNSmartCollectionViewCell class with the JS module;
创建用于搭载所述列表视图的RNSmartCollectionView类,并将所述RNSmartCollectionView类与所述JS模块桥接,其中,所述RNSmartCollectionView类中维护有模板属性和段落属性,所述模板属性用于存放注册给所述RNSmartCollectionView类的模板视图,所述段落属性用于存放所述所述RNSmartCollectionView类的数据源;Creating an RNSmartCollectionView class for carrying the list view, and bridging the RNSmartCollectionView class with the JS module, wherein the RNSmartCollectionView class maintains a template attribute and a paragraph attribute, where the template attribute is used to store the registration a template view of the RNSmartCollectionView class, where the paragraph attribute is used to store the data source of the RNSmartCollectionView class;
创建RNSmartCollectionTemplateView类。Create the RNSmartCollectionTemplateView class.
优选的,所述创建用于表征列表视图中单元壳视图的RNSmartCollectionViewCell类,包括:Advantageously, the creating an RNSmartCollectionViewCell class for characterizing a cell shell view in the list view comprises:
继承UICollectionViewCell创建所述RNSmartCollectionViewCell类。Inherit the UICollectionViewCell to create the RNSmartCollectionViewCell class.
优选的,所述创建用于搭载所述列表视图的RNSmartCollectionView类,包括:Preferably, the creating an RNSmartCollectionView class for carrying the list view includes:
继承UIView创建所述RNSmartCollectionView类,其中,所述RNSmartCollectionView类的内部创建有UICollectionView,所述UICollectionView作为所述RNSmartCollectionView类的子视图添加在所述RNSmartCollectionView类的视图层级中。Inheriting the UIView to create the RNSmartCollectionView class, wherein the RNSmartCollectionView class is internally created with a UICollectionView, and the UICollectionView is added as a child view of the RNSmartCollectionView class in the view hierarchy of the RNSmartCollectionView class.
优选的,所述利用所述JS模块调用所述RN集合视图类,创建所述RN集合视图类的实例,包括:Preferably, the invoking the RN set view class by using the JS module to create an instance of the RN set view class includes:
构建与所述模板属性对应的模板信息,以及与所述段落属性对应的段落信息;Constructing template information corresponding to the template attribute, and paragraph information corresponding to the paragraph attribute;
创建所述RNSmartCollectionView类的实例;Create an instance of the RNSmartCollectionView class;
将所述模板信息和所述段落信息传入所述RNSmartCollectionView类的实例中。Passing the template information and the paragraph information into an instance of the RNSmartCollectionView class.
本发明实施例还提供一种列表视图的实现装置,所述装置包括:An embodiment of the present invention further provides an apparatus for implementing a list view, where the apparatus includes:
第一创建模块,用于在利用OC语言开发的OC模块中,创建RN集合视图类,并将所述RN集合视图类与利用JS语言开发的JS模块进行桥接,所述RN集合视图类继承于UICollectionView;a first creating module, configured to create an RN set view class in an OC module developed by using an OC language, and bridge the RN set view class with a JS module developed by using a JS language, wherein the RN set view class inherits from UICollectionView;
第二创建模块,用于利用所述JS模块调用所述RN集合视图类,创建所述RN集合视图类的实例。And a second creating module, configured to invoke the RN set view class by using the JS module, and create an instance of the RN set view class.
优选的,所述第一创建模块,包括:Preferably, the first creating module includes:
第一创建单元,用于创建用于表征列表视图中单元壳视图的RNSmartCollectionViewCell类,并将所述RNSmartCollectionViewCell类与所述JS模块桥接;a first creating unit, configured to create an RNSmartCollectionViewCell class for characterizing a cell shell view in the list view, and bridging the RNSmartCollectionViewCell class with the JS module;
第二创建单元,用于创建用于搭载所述列表视图的RNSmartCollectionView类,并将所述RNSmartCollectionView类与所述JS模块桥接,其中,所述RNSmartCollectionView类中维护有模板属性和段落属性,所述模板属性用于存放注册给所述RNSmartCollectionView类的模板视图,所述段落属性用于存放所述所述RNSmartCollectionView类的数据源;a second creating unit, configured to create an RNSmartCollectionView class for carrying the list view, and bridging the RNSmartCollectionView class with the JS module, where the template and the paragraph attribute are maintained in the RNSmartCollectionView class, where the template is The attribute is used to store a template view registered to the RNSmartCollectionView class, where the paragraph attribute is used to store the data source of the RNSmartCollectionView class;
第三创建单元,用于创建RNSmartCollectionTemplateView类。The third creation unit is used to create the RNSmartCollectionTemplateView class.
优选的,所述第一创建单元,具体用于:Preferably, the first creating unit is specifically configured to:
继承UICollectionViewCell创建所述RNSmartCollectionViewCell类。Inherit the UICollectionViewCell to create the RNSmartCollectionViewCell class.
本发明实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现以下步骤:The embodiment of the invention further provides a computer readable storage medium, on which a computer program is stored, and when the program is executed by the processor, the following steps are implemented:
在利用OC语言开发的OC模块中,创建RN集合视图类,并将所述RN集合视图类与利用JS语言开发的JS模块进行桥接,所述RN集合视图类继承于UICollectionView;In the OC module developed by using the OC language, the RN set view class is created, and the RN set view class is bridged with the JS module developed by the JS language, and the RN set view class inherits from the UICollectionView;
利用所述JS模块调用所述RN集合视图类,创建所述RN集合视图类的实例。The RN set view class is invoked by the JS module to create an instance of the RN set view class.
本发明实施例还提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现以下步骤:The embodiment of the invention further provides a computer device, comprising a memory, a processor and a computer program stored on the memory and operable on the processor, the processor implementing the program to implement the following steps:
在利用OC语言开发的OC模块中,创建RN集合视图类,并将所述RN集合视图类与利用JS语言开发的JS模块进行桥接,所述RN集合视图类继承于UICollectionView;In the OC module developed by using the OC language, the RN set view class is created, and the RN set view class is bridged with the JS module developed by the JS language, and the RN set view class inherits from the UICollectionView;
利用所述JS模块调用所述RN集合视图类,创建所述RN集合视图类的实例。The RN set view class is invoked by the JS module to create an instance of the RN set view class.
本发明实施例中的一个或多个技术方案,至少具有如下技术效果或优点:One or more technical solutions in the embodiments of the present invention have at least the following technical effects or advantages:
本申请利用OC模块创建RN集合视图类,并将RN集合视图类与利用JS语言开发的JS模块进行桥接,RN集合视图类继承于UICollectionView,再利用JS模块调用RN集合视图类,创建RN集合视图类的实例,由于利用具有重用机制的UICollectionView进行桥接,使得将重用机制引入到列表视图的实现过程中,提高了无限滑动列表的性能,对于无限滑动列表而言,无论从内存还是从计算资源上均能够降低资源的消耗,避免了因占用内存过高而被系统杀死。This application uses the OC module to create the RN set view class, and bridges the RN set view class with the JS module developed by the JS language. The RN set view class inherits from the UICollectionView, and then uses the JS module to call the RN set view class to create the RN set view. An instance of a class, which is bridged by a UICollectionView with reuse mechanism, introduces the reuse mechanism into the implementation of the list view, improving the performance of the infinitely sliding list, for infinitely sliding lists, whether from memory or computing resources. Both can reduce the consumption of resources and avoid being killed by the system due to excessive memory usage.
附图说明DRAWINGS
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考图形表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those skilled in the art from a The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting. Further, the same components are denoted by the same reference numerals throughout the drawings. In the drawing:
图1示出了本发明实施例中的列表视图的实现方法的流程图;FIG. 1 is a flowchart showing a method for implementing a list view in an embodiment of the present invention;
图2示出了本发明实施例中的列表视图的实现装置的结构图;2 is a structural diagram of an apparatus for implementing a list view in an embodiment of the present invention;
图3示出了本发明实施例中的计算机设备的实体结构示意图。FIG. 3 is a schematic diagram showing the physical structure of a computer device in an embodiment of the present invention.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本 公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the embodiments of the present invention have been shown in the drawings, the embodiments Rather, these embodiments are provided so that this disclosure will be more fully understood, and the scope of the disclosure may be fully conveyed by those skilled in the art.
本申请实施例提供一种列表视图的实现方法,应用于包含OC模块和JS模块的客户端中,其中,OC模块利用OC语言(Objective-C)开发,JS模块利用JS语言开发。如图1所示,所述方法包括:The embodiment of the present application provides a method for implementing a list view, which is applied to a client that includes an OC module and a JS module. The OC module is developed by using an OC language (Objective-C), and the JS module is developed by using a JS language. As shown in FIG. 1, the method includes:
步骤101:在OC模块中,创建RN集合视图类,并将RN集合视图类与JS模块进行桥接,RN集合视图类继承于UICollectionView。Step 101: In the OC module, create an RN set view class, and bridge the RN set view class with the JS module, and the RN set view class inherits from the UICollectionView.
步骤102:利用JS模块调用RN集合视图类,创建RN集合视图类的实例。Step 102: The RN set view class is invoked by using the JS module to create an instance of the RN set view class.
下面将分别从OC模块JS模块两端对本申请的列表视图的实现方法进行详细介绍。The implementation method of the list view of this application will be described in detail from the two ends of the OC module JS module.
在OC模块端,对于创建RN集合视图类并将RN集合视图类与JS模块进行桥接,具体包括:On the OC module, the RN set view class is created and the RN set view class is bridged with the JS module, including:
创建用于表征列表视图中单元壳视图的RNSmartCollectionViewCell类,并将RNSmartCollectionViewCell类与JS模块桥接。具体地,继承UICollectionViewCell创建RNSmartCollectionViewCell类,该类包含列表视图中每个单元的壳视图,再桥接RNSmartCollectionViewCell类,使得JS模块能够创建RNSmartCollectionViewCell类的实例。Create an RNSmartCollectionViewCell class that represents the cell shell view in the list view and bridge the RNSmartCollectionViewCell class with the JS module. Specifically, inheriting the UICollectionViewCell creates the RNSmartCollectionViewCell class, which contains the shell view of each cell in the list view, and then bridges the RNSmartCollectionViewCell class, enabling the JS module to create an instance of the RNSmartCollectionViewCell class.
创建用于搭载列表视图的RNSmartCollectionView类,并将RNSmartCollectionView类与JS模块桥接,其中,RNSmartCollectionView类中维护有模板(templates)属性和段落(sections)属性,模板属性用于存放注册给RNSmartCollectionView类的模板视图,段落属性用于存放RNSmartCollectionView类的数据源。具体地,继承UIView创建RNSmartCollectionView类,RNSmartCollectionView类的内部创建有UICollectionView,UICollectionView作为RNSmartCollectionView类的子视图添加在RNSmartCollectionView类的视图层级中,同时,为UICollectionView提供数据源。Create an RNSmartCollectionView class for the list view, and bridge the RNSmartCollectionView class with the JS module. The RNSmartCollectionView class maintains templates and sections properties. The template properties are used to store the template view registered to the RNSmartCollectionView class. The paragraph attribute is used to store the data source of the RNSmartCollectionView class. Specifically, the UIView is created to inherit the RNSmartCollectionView class. The RNSmartCollectionView class is internally created with a UICollectionView. The UICollectionView is added as a subview of the RNSmartCollectionView class in the view hierarchy of the RNSmartCollectionView class, and provides a data source for the UICollectionView.
进一步,模板属性为字典类型,其用于存放注册给RNSmartCollectionView类的模板视图,此视图的调用方可以通过给模板属性进行复制,以传入具有自定义样式的所有模板视图,结合UICollectionView的重用机制,UICollectionView每次需要创建新的RNSmartCollectionViewCell类时,会根据重用标识符从模板属性中获取到对应的模板视图,然后对此视图进行拷贝,得到一个与模板视图具有相同样式和数据的视图,然后添加到RNSmartCollectionViewCell中,由此实现了一个具有自定义样式的单元视图的创建。Further, the template attribute is a dictionary type, which is used to store a template view registered to the RNSmartCollectionView class. The caller of this view can copy all the template views with custom styles by copying the template attributes, and combine the reuse mechanism of UICollectionView. Each time the UICollectionView needs to create a new RNSmartCollectionViewCell class, it will get the corresponding template view from the template property according to the reuse identifier, then copy this view to get a view with the same style and data as the template view, and then add Into the RNSmartCollectionViewCell, the creation of a unit view with a custom style is implemented.
进一步,段落属性为数组类型,其用于存放数据源,通过此数据源,调用 方可以传入每个单元视图所需要的各种信息,如重用标识符和单元视图尺寸等,同时配合模板属性,由此实现了根据外部传入的配置来动态创建具有自定义样式的单元视图。Further, the paragraph attribute is an array type, which is used to store a data source. Through this data source, the caller can pass in various information required by each unit view, such as reusing identifiers and unit view sizes, etc., together with template attributes. This enables a dynamically created unit view with custom styles based on externally passed in configuration.
创建RNSmartCollectionTemplateView类。在创建RNSmartCollectionTemplateView类的过程中,可以利用copiedTemplateView方法,先返回一个该视图实例的拷贝,再通过对一个RNSmartCollectionTemplateView实例调用copiedTemplateView方法获取到一个与该视图实例完全一样的实例,接着,利用configureWithltem:templateView:方法对拷贝得到的复制视图进行配置,例如进行数据的填充。Create the RNSmartCollectionTemplateView class. In the process of creating the RNSmartCollectionTemplateView class, you can use the copiedTemplateView method to return a copy of the view instance first, and then call the copiedTemplateView method on an RNSmartCollectionTemplateView instance to get an instance identical to the view instance. Then, use configureWithltem:templateView: The method configures the copy view obtained by copying, for example, filling the data.
在JS模块端,首先,构建与模板属性对应的模板(templates)信息,具体的,通过与JS模块桥接的OC端的RNSmartCollectionViewCell类提供的Cell标签,可以向边写普通HTML页面一样通过给Cell标签提供各种子标签来实现自定义样式的视图,将这些模板视图指定重用标识符之后存入到templates字典中。以及构建与段落属性对应的段落(sections)信息,具体的,对列表要展示的数据源进行处理,添加重用标识符与模板信息。接着,创建RNSmartCollectionView类的实例,再将模板信息和段落信息传入RNSmartCollectionView类的实例中。On the JS module side, first, the template information corresponding to the template attribute is constructed. Specifically, the Cell label provided by the RN SmartCollectionViewCell class of the OC end bridged with the JS module can be provided to the Cell label by writing an ordinary HTML page. Various subtags are used to implement custom style views, and these template views are assigned to reuse identifiers and then stored in the templates dictionary. And constructing section information corresponding to the paragraph attribute, specifically, processing the data source to be displayed in the list, adding the reuse identifier and the template information. Next, create an instance of the RNSmartCollectionView class, and pass the template information and paragraph information to the instance of the RNSmartCollectionView class.
在本申请中,将UICollectionView作为列表视图,其拥有重用机制,当每个列表单元视图滑出屏幕时,将会被添加到重用队列中,当列表单元视图滑入屏幕时,将会先从重用队列中取出列表单元视图实例,再直接复用,如果从重用队列中取不出列表单元视图实例,再重新进行创建,因此,利用UICollectionView实现列表视图的调用无论从内存还是从计算资源上均能够降低资源的消耗。In this application, the UICollectionView is used as a list view, which has a reuse mechanism. When each list unit view slides out of the screen, it will be added to the reuse queue. When the list unit view slides into the screen, it will be reused first. The list unit view instance is taken out from the queue, and then directly reused. If the list unit view instance is not retrieved from the reuse queue, the list view view instance is re-created. Therefore, the use of the UICollectionView to implement the list view call can be performed from both the memory and the computing resource. Reduce resource consumption.
基于同一发明构思,本发明实施例还提供一种列表视图的实现装置,如图2所示,所述装置包括:Based on the same inventive concept, an embodiment of the present invention further provides a device for implementing a list view. As shown in FIG. 2, the device includes:
第一创建模块201,用于在利用OC语言开发的OC模块中,创建RN集合视图类,并将所述RN集合视图类与利用JS语言开发的JS模块进行桥接,所述RN集合视图类继承于UICollectionView;The first creating module 201 is configured to create an RN set view class in an OC module developed by using an OC language, and bridge the RN set view class with a JS module developed by using a JS language, where the RN set view class inherits In UICollectionView;
第二创建模块202,用于利用所述JS模块调用所述RN集合视图类,创建所述RN集合视图类的实例。The second creating module 202 is configured to invoke the RN set view class by using the JS module to create an instance of the RN set view class.
优选的,第一创建模块201,包括:Preferably, the first creating module 201 includes:
第一创建单元,用于创建用于表征列表视图中单元壳视图的RNSmartCollectionViewCell类,并将所述RNSmartCollectionViewCell类与所 述JS模块桥接;a first creating unit, configured to create an RNSmartCollectionViewCell class for representing a cell shell view in the list view, and bridging the RNSmartCollectionViewCell class with the JS module;
第二创建单元,用于创建用于搭载所述列表视图的RNSmartCollectionView类,并将所述RNSmartCollectionView类与所述JS模块桥接,其中,所述RNSmartCollectionView类中维护有模板属性和段落属性,所述模板属性用于存放注册给所述RNSmartCollectionView类的模板视图,所述段落属性用于存放所述所述RNSmartCollectionView类的数据源;a second creating unit, configured to create an RNSmartCollectionView class for carrying the list view, and bridging the RNSmartCollectionView class with the JS module, where the template and the paragraph attribute are maintained in the RNSmartCollectionView class, where the template is The attribute is used to store a template view registered to the RNSmartCollectionView class, where the paragraph attribute is used to store the data source of the RNSmartCollectionView class;
第三创建单元,用于创建RNSmartCollectionTemplateView类。The third creation unit is used to create the RNSmartCollectionTemplateView class.
优选的,所述第一创建单元,具体用于:Preferably, the first creating unit is specifically configured to:
继承UICollectionViewCell创建所述RNSmartCollectionViewCell类。Inherit the UICollectionViewCell to create the RNSmartCollectionViewCell class.
优选的,所述第二创建单元,具体用于:Preferably, the second creating unit is specifically configured to:
继承UIView创建所述RNSmartCollectionView类,其中,所述RNSmartCollectionView类的内部创建有UICollectionView,所述UICollectionView作为所述RNSmartCollectionView类的子视图添加在所述RNSmartCollectionView类的视图层级中。Inheriting the UIView to create the RNSmartCollectionView class, wherein the RNSmartCollectionView class is internally created with a UICollectionView, and the UICollectionView is added as a child view of the RNSmartCollectionView class in the view hierarchy of the RNSmartCollectionView class.
优选的,第二创建模块202,包括:Preferably, the second creating module 202 includes:
构建单元,用于构建与所述模板属性对应的模板信息,以及与所述段落属性对应的段落信息;a building unit, configured to construct template information corresponding to the template attribute, and paragraph information corresponding to the paragraph attribute;
第四创建单元,用于创建所述RNSmartCollectionView类的实例;a fourth creating unit, configured to create an instance of the RNSmartCollectionView class;
传入单元,用于将所述模板信息和所述段落信息传入所述RNSmartCollectionView类的实例中。An incoming unit, configured to pass the template information and the paragraph information into an instance of the RNSmartCollectionView class.
基于同一发明构思,本发明实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现以下步骤:Based on the same inventive concept, an embodiment of the present invention further provides a computer readable storage medium, where a computer program is stored, and when the program is executed by the processor, the following steps are implemented:
在利用OC语言开发的OC模块中,创建RN集合视图类,并将所述RN集合视图类与利用JS语言开发的JS模块进行桥接,所述RN集合视图类继承于UICollectionView;In the OC module developed by using the OC language, the RN set view class is created, and the RN set view class is bridged with the JS module developed by the JS language, and the RN set view class inherits from the UICollectionView;
利用所述JS模块调用所述RN集合视图类,创建所述RN集合视图类的实例。The RN set view class is invoked by the JS module to create an instance of the RN set view class.
本发明实施例还提供了一种计算机设备,如图3所示,为了便于说明,仅示出了与本发明实施例相关的部分,具体技术细节未揭示的,请参照本发明实施例方法部分。该计算机设备可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑等任意终端设备,以计算机设备为手机为例:The embodiment of the present invention further provides a computer device. As shown in FIG. 3, for the convenience of description, only parts related to the embodiment of the present invention are shown. If the specific technical details are not disclosed, please refer to the method part of the embodiment of the present invention. . The computer device may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), an in-vehicle computer, and the like, and the computer device is used as a mobile phone as an example:
图3示出的是与本发明实施例提供的计算机设备相关的部分结构的框图。参考图3,该计算机设备包括:存储器301和处理器302。本领域技术人员可以理解,图3中示出的计算机设备结构并不构成对计算机设备的限定,可以包括 比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。3 is a block diagram showing a portion of the structure associated with a computer device provided by an embodiment of the present invention. Referring to FIG. 3, the computer device includes a memory 301 and a processor 302. Those skilled in the art will appreciate that the computer device architecture illustrated in Figure 3 does not constitute a limitation to a computer device, and may include more or fewer components than those illustrated, or a combination of certain components, or different component arrangements.
下面结合图3对计算机设备的各个构成部件进行具体的介绍:The specific components of the computer device will be specifically described below with reference to FIG. 3:
存储器301可用于存储软件程序以及模块,处理器302通过运行存储在存储器301的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器301可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储数据(比如音频数据、电话本等)等。此外,存储器301可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 301 can be used to store software programs and modules, and the processor 302 executes various functional applications and data processing by running software programs and modules stored in the memory 301. The memory 301 can mainly include a storage program area and a storage data area, wherein the storage program area can store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area can store data. (such as audio data, phone book, etc.). Further, the memory 301 may include a high speed random access memory, and may also include a nonvolatile memory such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
处理器302是计算机设备的控制中心,通过运行或执行存储在存储器301内的软件程序和/或模块,以及调用存储在存储器301内的数据,执行各种功能和处理数据。可选的,处理器302可包括一个或多个处理单元;优选的,处理器302可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。The processor 302 is a control center of a computer device that performs various functions and processing data by running or executing software programs and/or modules stored in the memory 301, and recalling data stored in the memory 301. Optionally, the processor 302 may include one or more processing units; preferably, the processor 302 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like. The modem processor primarily handles wireless communications.
在本发明实施例中,该计算机设备所包括的处理器302可以具有以下功能:In the embodiment of the present invention, the processor 302 included in the computer device may have the following functions:
在利用OC语言开发的OC模块中,创建RN集合视图类,并将所述RN集合视图类与利用JS语言开发的JS模块进行桥接,所述RN集合视图类继承于UICollectionView;In the OC module developed by using the OC language, the RN set view class is created, and the RN set view class is bridged with the JS module developed by the JS language, and the RN set view class inherits from the UICollectionView;
利用所述JS模块调用所述RN集合视图类,创建所述RN集合视图类的实例。The RN set view class is invoked by the JS module to create an instance of the RN set view class.
总之,本申请利用OC模块创建RN集合视图类,并将RN集合视图类与利用JS语言开发的JS模块进行桥接,RN集合视图类继承于UICollectionView,再利用JS模块调用RN集合视图类,创建RN集合视图类的实例,由于利用具有重用机制的UICollectionView进行桥接,使得将重用机制引入到列表视图的实现过程中,提高了无限滑动列表的性能,对于无限滑动列表而言,无论从内存还是从计算资源上均能够降低资源的消耗,避免了因占用内存过高而被系统杀死。In summary, the present application uses the OC module to create an RN set view class, and bridges the RN set view class with a JS module developed using the JS language. The RN set view class inherits from the UICollectionView, and then uses the JS module to call the RN set view class to create an RN. An instance of a collection view class, which is bridged by a UICollectionView with reuse mechanism, introduces the reuse mechanism into the implementation of the list view, improving the performance of the infinite sliding list, for infinite sliding lists, whether from memory or computing Resources can reduce the consumption of resources, and avoid being killed by the system due to excessive memory usage.
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general purpose systems can also be used with the teaching based on the teachings herein. The structure required to construct such a system is apparent from the above description. Moreover, the invention is not directed to any particular programming language. It is to be understood that the invention may be embodied in a variety of programming language, and the description of the specific language has been described above in order to disclose the preferred embodiments of the invention.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that the embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of the description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或 多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, the various features of the invention are sometimes grouped together into a single embodiment, in the above description of the exemplary embodiments of the invention, Figure, or a description of it. However, the method disclosed is not to be interpreted as reflecting the intention that the claimed invention requires more features than those specifically recited in the claims. Rather, as the following claims reflect, inventive aspects reside in less than all features of the single embodiments disclosed herein. Therefore, the claims following the specific embodiments are hereby explicitly incorporated into the embodiments, and each of the claims as a separate embodiment of the invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art will appreciate that the modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components. In addition to such features and/or at least some of the processes or units being mutually exclusive, any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined. Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
此外,本领域的技术人员能够理解,尽管在此的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。In addition, those skilled in the art will appreciate that although some embodiments herein include certain features included in other embodiments and not other features, combinations of features of different embodiments are intended to be within the scope of the present invention. And different embodiments are formed. For example, in the following claims, any one of the claimed embodiments can be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的网关、代理服务器、系统中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functionality of some, or all, of the gateways, proxy servers, systems in accordance with embodiments of the present invention. The invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein. Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包 括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It is to be noted that the above-described embodiments are illustrative of the invention and are not intended to be limiting, and that the invention may be devised without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as a limitation. The word "comprising" does not exclude the presence of the elements or steps that are not recited in the claims. The word "a" or "an" The invention can be implemented by means of hardware comprising several distinct elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by the same hardware item. The use of words, second, third, etc. does not indicate any order. These words can be interpreted as names.

Claims (10)

  1. 一种列表视图的实现方法,其特征在于,所述方法包括:A method for implementing a list view, the method comprising:
    在利用OC语言开发的OC模块中,创建RN集合视图类,并将所述RN集合视图类与利用JS语言开发的JS模块进行桥接,所述RN集合视图类继承于UICollectionView;In the OC module developed by using the OC language, the RN set view class is created, and the RN set view class is bridged with the JS module developed by the JS language, and the RN set view class inherits from the UICollectionView;
    利用所述JS模块调用所述RN集合视图类,创建所述RN集合视图类的实例。The RN set view class is invoked by the JS module to create an instance of the RN set view class.
  2. 如权利要求1所述的方法,其特征在于,所述创建RN集合视图类,并将所述RN集合视图类与利用JS语言开发的JS模块进行桥接,包括:The method of claim 1, wherein the creating an RN set view class and bridging the RN set view class with a JS module developed using a JS language comprises:
    创建用于表征列表视图中单元壳视图的RNSmartCollectionViewCell类,并将所述RNSmartCollectionViewCell类与所述JS模块桥接;Creating an RNSmartCollectionViewCell class for characterizing a cell shell view in the list view, and bridging the RNSmartCollectionViewCell class with the JS module;
    创建用于搭载所述列表视图的RNSmartCollectionView类,并将所述RNSmartCollectionView类与所述JS模块桥接,其中,所述RNSmartCollectionView类中维护有模板属性和段落属性,所述模板属性用于存放注册给所述RNSmartCollectionView类的模板视图,所述段落属性用于存放所述所述RNSmartCollectionView类的数据源;Creating an RNSmartCollectionView class for carrying the list view, and bridging the RNSmartCollectionView class with the JS module, wherein the RNSmartCollectionView class maintains a template attribute and a paragraph attribute, where the template attribute is used to store the registration a template view of the RNSmartCollectionView class, where the paragraph attribute is used to store the data source of the RNSmartCollectionView class;
    创建RNSmartCollectionTemplateView类。Create the RNSmartCollectionTemplateView class.
  3. 如权利要求2所述的方法,其特征在于,所述创建用于表征列表视图中单元壳视图的RNSmartCollectionViewCell类,包括:The method of claim 2, wherein the creating an RNSmartCollectionViewCell class for characterizing a cell shell view in a list view comprises:
    继承UICollectionViewCell创建所述RNSmartCollectionViewCell类。Inherit the UICollectionViewCell to create the RNSmartCollectionViewCell class.
  4. 如权利要求2所述的方法,其特征在于,所述创建用于搭载所述列表视图的RNSmartCollectionView类,包括:The method of claim 2, wherein the creating an RNSmartCollectionView class for piggybacking the list view comprises:
    继承UIView创建所述RNSmartCollectionView类,其中,所述RNSmartCollectionView类的内部创建有UICollectionView,所述UICollectionView作为所述RNSmartCollectionView类的子视图添加在所述RNSmartCollectionView类的视图层级中。Inheriting the UIView to create the RNSmartCollectionView class, wherein the RNSmartCollectionView class is internally created with a UICollectionView, and the UICollectionView is added as a child view of the RNSmartCollectionView class in the view hierarchy of the RNSmartCollectionView class.
  5. 如权利要求2所述的方法,其特征在于,所述利用所述JS模块调用所述RN集合视图类,创建所述RN集合视图类的实例,包括:The method according to claim 2, wherein the invoking the RN set view class by using the JS module to create an instance of the RN set view class comprises:
    构建与所述模板属性对应的模板信息,以及与所述段落属性对应的段落信息;Constructing template information corresponding to the template attribute, and paragraph information corresponding to the paragraph attribute;
    创建所述RNSmartCollectionView类的实例;Create an instance of the RNSmartCollectionView class;
    将所述模板信息和所述段落信息传入所述RNSmartCollectionView类的实例中。Passing the template information and the paragraph information into an instance of the RNSmartCollectionView class.
  6. 一种列表视图的实现装置,其特征在于,所述装置包括:A device for implementing a list view, characterized in that the device comprises:
    第一创建模块,用于在利用OC语言开发的OC模块中,创建RN集合视图类, 并将所述RN集合视图类与利用JS语言开发的JS模块进行桥接,所述RN集合视图类继承于UICollectionView;a first creating module, configured to create an RN set view class in an OC module developed by using an OC language, and bridge the RN set view class with a JS module developed by using a JS language, wherein the RN set view class inherits from UICollectionView;
    第二创建模块,用于利用所述JS模块调用所述RN集合视图类,创建所述RN集合视图类的实例。And a second creating module, configured to invoke the RN set view class by using the JS module, and create an instance of the RN set view class.
  7. 如权利要求6所述的装置,其特征在于,所述第一创建模块,包括:The device of claim 6, wherein the first creation module comprises:
    第一创建单元,用于创建用于表征列表视图中单元壳视图的RNSmartCollectionViewCell类,并将所述RNSmartCollectionViewCell类与所述JS模块桥接;a first creating unit, configured to create an RNSmartCollectionViewCell class for characterizing a cell shell view in the list view, and bridging the RNSmartCollectionViewCell class with the JS module;
    第二创建单元,用于创建用于搭载所述列表视图的RNSmartCollectionView类,并将所述RNSmartCollectionView类与所述JS模块桥接,其中,所述RNSmartCollectionView类中维护有模板属性和段落属性,所述模板属性用于存放注册给所述RNSmartCollectionView类的模板视图,所述段落属性用于存放所述所述RNSmartCollectionView类的数据源;a second creating unit, configured to create an RNSmartCollectionView class for carrying the list view, and bridging the RNSmartCollectionView class with the JS module, where the template and the paragraph attribute are maintained in the RNSmartCollectionView class, where the template is The attribute is used to store a template view registered to the RNSmartCollectionView class, where the paragraph attribute is used to store the data source of the RNSmartCollectionView class;
    第三创建单元,用于创建RNSmartCollectionTemplateView类。The third creation unit is used to create the RNSmartCollectionTemplateView class.
  8. 如权利要求7所述的装置,其特征在于,所述第一创建单元,具体用于:The device according to claim 7, wherein the first creating unit is specifically configured to:
    继承UICollectionViewCell创建所述RNSmartCollectionViewCell类。Inherit the UICollectionViewCell to create the RNSmartCollectionViewCell class.
  9. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现以下步骤:A computer readable storage medium having stored thereon a computer program, wherein the program, when executed by the processor, implements the following steps:
    在利用OC语言开发的OC模块中,创建RN集合视图类,并将所述RN集合视图类与利用JS语言开发的JS模块进行桥接,所述RN集合视图类继承于UICollectionView;In the OC module developed by using the OC language, the RN set view class is created, and the RN set view class is bridged with the JS module developed by the JS language, and the RN set view class inherits from the UICollectionView;
    利用所述JS模块调用所述RN集合视图类,创建所述RN集合视图类的实例。The RN set view class is invoked by the JS module to create an instance of the RN set view class.
  10. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现以下步骤:A computer device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor performs the following steps when executing the program:
    在利用OC语言开发的OC模块中,创建RN集合视图类,并将所述RN集合视图类与利用JS语言开发的JS模块进行桥接,所述RN集合视图类继承于UICollectionView;In the OC module developed by using the OC language, the RN set view class is created, and the RN set view class is bridged with the JS module developed by the JS language, and the RN set view class inherits from the UICollectionView;
    利用所述JS模块调用所述RN集合视图类,创建所述RN集合视图类的实例。The RN set view class is invoked by the JS module to create an instance of the RN set view class.
PCT/CN2018/082342 2017-10-09 2018-04-09 Method and apparatus for implementing list view, and readable storage medium and device WO2019071928A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710929544.XA CN107678741B (en) 2017-10-09 2017-10-09 List view implementation method and device, readable storage medium and equipment
CN201710929544.X 2017-10-09

Publications (1)

Publication Number Publication Date
WO2019071928A1 true WO2019071928A1 (en) 2019-04-18

Family

ID=61139895

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/082342 WO2019071928A1 (en) 2017-10-09 2018-04-09 Method and apparatus for implementing list view, and readable storage medium and device

Country Status (2)

Country Link
CN (1) CN107678741B (en)
WO (1) WO2019071928A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110475141A (en) * 2019-08-29 2019-11-19 深圳市网心科技有限公司 Video broadcasting method, system and electronic equipment and storage medium based on RN

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107678741B (en) * 2017-10-09 2020-09-08 武汉斗鱼网络科技有限公司 List view implementation method and device, readable storage medium and equipment
CN108595160B (en) * 2018-05-16 2022-04-01 福建天泉教育科技有限公司 Method and storage medium for calling native object by JS
CN109062653B (en) * 2018-08-20 2022-02-25 珠海市筑巢科技有限公司 Long image-text information display method, computer device and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102222012A (en) * 2010-04-14 2011-10-19 微软公司 Static type checking against external data sources
CN105302558A (en) * 2015-11-03 2016-02-03 北京京东尚科信息技术有限公司 Content presentation system and method for multiple clients
CN107678741A (en) * 2017-10-09 2018-02-09 武汉斗鱼网络科技有限公司 Implementation method, device, readable storage medium storing program for executing and the equipment of List View

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102520918A (en) * 2011-09-27 2012-06-27 深圳市五巨科技有限公司 Method and device for increasing list refreshing frequency
KR101416100B1 (en) * 2012-08-07 2014-07-14 인크로스 주식회사 An interface for interworking with javascripts in hybrid web applications
CN105930467B (en) * 2016-04-22 2019-10-29 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN107045438B (en) * 2016-12-16 2020-03-27 阿里巴巴集团控股有限公司 Application top view processing method, device and component
CN106685726A (en) * 2017-01-11 2017-05-17 重庆邮电大学 React-native based intelligent home monitoring system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102222012A (en) * 2010-04-14 2011-10-19 微软公司 Static type checking against external data sources
CN105302558A (en) * 2015-11-03 2016-02-03 北京京东尚科信息技术有限公司 Content presentation system and method for multiple clients
CN107678741A (en) * 2017-10-09 2018-02-09 武汉斗鱼网络科技有限公司 Implementation method, device, readable storage medium storing program for executing and the equipment of List View

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"iOS -UICollectionView (OC) (Non-official translation: iOS control-UICollectionView basic use (OC", DEVELOPER_CYX, 15 March 2016 (2016-03-15), pages 1 - 4, Retrieved from the Internet <URL:https://www.jianshu.com/p/0dle2e067f6c> *
CHEN, XIANGYANGHA: "Implementing OC and JS interaction using Web View Javascript Bridge", WEBVIEWJAVASCRIPT BRIDGE OC JS, 29 September 2015 (2015-09-29), pages 1, XP055591074, Retrieved from the Internet <URL:https://www.jianshu.com/p/ca496cb680fe> *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110475141A (en) * 2019-08-29 2019-11-19 深圳市网心科技有限公司 Video broadcasting method, system and electronic equipment and storage medium based on RN

Also Published As

Publication number Publication date
CN107678741B (en) 2020-09-08
CN107678741A (en) 2018-02-09

Similar Documents

Publication Publication Date Title
US11176485B2 (en) Dynamic integration of machine-learning modules
US8266551B2 (en) Method and apparatus for binding user interface elements and granular reflective processing
WO2019071928A1 (en) Method and apparatus for implementing list view, and readable storage medium and device
US10650048B2 (en) Managing complex service dependencies in a data integration system
CN107832099B (en) Method and device for client version compatibility and storage medium
US8639749B2 (en) Platform independent information handling system, communication method, and computer program product thereof
US11030079B2 (en) Service virtualization platform
WO2017157178A1 (en) Mobile terminal application update method and device
JP2018537783A (en) Run the application using pre-generated components
WO2018090871A1 (en) Application service indication method and application service indication device
WO2019034066A1 (en) Page update method and apparatus
CN112817657A (en) Application program starting item loading method, device and system and storage medium
US20170329622A1 (en) Shared virtual data structure of nested hypervisors
CN108156009B (en) Service calling method and device
MacIntyre et al. Pro PHP programming
WO2023160367A1 (en) Data transfer method and system
WO2017166640A1 (en) Application calling method and terminal
US20190227678A1 (en) Providing document feature management in relation to communication
CN106502707A (en) Code generating method and device
CN109491806A (en) Adaptation method and device between a kind of kernel and third-party application
WO2020064000A1 (en) Method and apparatus for displaying message box, terminal and storage medium
US10602332B2 (en) Programming organizational links that propagate to mobile applications
CN114185845A (en) File management method and device, computer equipment and storage medium
WO2019237780A1 (en) Android system activity launching method and device
CN113568879B (en) File attribute adding method, computing device and storage medium

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: 18866332

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18866332

Country of ref document: EP

Kind code of ref document: A1