Table view rolling operation method and device, medium and product
By realizing the interconnection between table view and scroll view on the development platform, the weak problems of commonly used development platforms in peripheral support are solved, which improves interaction fluency and reduces development costs.
Patent Information
- Application Number
- CN202411985937.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-29
AI Technical Summary
Commonly used development platforms are relatively weak in peripheral support, resulting in high development costs, especially when implementing the linkage function between table view and scroll view.
A scrolling operation method for table view is provided. By determining the size information of the target table view cell and the visual range information of the scroll view, the scroll distance is automatically calculated to realize the interconnection between the table view and the scroll view.
It improves the fluency and efficiency of user-interface interaction, reduces development costs, and adapts to the development needs of all-platform games.
Smart Images

Figure CN119902684A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a scrolling operation method, device, medium and product for a table view. Background Art
[0002] Scroll view is an indispensable basic component in UI system. Most development platforms, such as Unity, Unreal Engine (UE), iOS and Android, provide a basic scroll view. If users have more complex requirements, they can also develop the scroll view by themselves. Table view is also a basic component, but not all development platforms provide table view. For example, iOS system comes with a table view, and it is usually recommended to put the table view into a scroll view. But Unity does not provide a table view, so developers need to develop it by themselves.
[0003] In the related art, the scroll view and table view provided by default on different development platforms support different functions.
[0004] However, the inventors found that there are at least the following technical problems in the related art:
[0005] As modern large-scale mobile games are gradually evolving towards full-platform games, players' demands for peripherals are also gradually increasing. Players not only need games to support touch screen operations, but also hope to use keyboard operations on PCs, external controller operations on mobile phones and PCs, and even experience games on game consoles. Therefore, the UI system must be able to support the focus mechanism to adapt to the operation requirements of different platforms and peripherals. Taking Unity and iOS as examples, these two development platforms focus more on mobile development, so the table view does not provide the "select an item" function, that is, it is not allowed to let a subview of the table view get the focus. This function is usually only required when using peripherals such as keyboards and controllers for operation, while on mobile terminals, users are more likely to interact directly with the interface through touch.
[0006] In summary, in the related technologies, the commonly used development platforms are relatively weak in supporting peripherals, and users are required to develop them by themselves, resulting in high development costs. Summary of the invention
[0007] One purpose of the present application is to provide a scrolling operation method, device, medium and product for a table view, at least to solve the technical problem in related technologies that commonly used development platforms are relatively weak in supporting peripherals, resulting in high development costs.
[0008] To achieve the above objectives, some embodiments of the present application provide the following aspects:
[0009] In a first aspect, some embodiments of the present application also provide a method for scrolling a table view, the method comprising: determining first size information of a target table view cell; the target table view cell is used to represent a table view cell that has focus among the table view cells of the table view; determining second size information of a visible range of the scrolling view; determining a scrolling distance based on the first size information and the second size information, so as to perform a scrolling operation on the scrolling view based on the scrolling distance; wherein the scrolling distance is used to represent that the target table view cell is aligned to a preset position of the visible range.
[0010] In a second aspect, some embodiments of the present application further provide an electronic device, comprising: one or more processors; and a memory storing computer program instructions, wherein the computer program instructions, when executed, cause the processor to perform the steps of the method described above.
[0011] In a third aspect, some embodiments of the present application further provide a computer-readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method as described above.
[0012] In a fourth aspect, some embodiments of the present application further provide a computer program product, comprising a computer program / instruction, which implements the steps of the method described above when executed by a processor.
[0013] It can be understood that in the related art, the commonly used development platform not only does not support the linkage function between focus and scroll view, but even does not provide a basic table view. Compared with the related art, the scheme provided in the embodiment of the present application realizes the mutual linkage between the table view and the scroll view. The function of mutual linkage between the table view and the scroll view is added. First, by determining the first size information of the target table view cell that obtains the focus in the table view, the first size information is used to characterize the actual space occupied by the target table view cell in the table view layout. Then, the second size information of the current visible range of the scroll view is determined, and the visible range characterizes the boundary of the area directly visible to the user. Finally, the system can automatically calculate the scroll distance based on the first size information and the second size information to align the target table view cell to the preset position of the visible range. It can be understood that the scroll distance is the amount of movement required to completely align the target table view cell to the preset position of the visible range. The scrolling operation performed on the scroll view based on the scroll distance can ensure that the target table view cell can be properly displayed within the visible range, improving the fluency and efficiency of the user's interaction with the interface. This embodiment is particularly suitable for processing data display and scrolling in table views, for example, in the interface design of mobile applications that require users to scroll frequently, it can effectively improve the usability of the interface and the accessibility of information. In this embodiment, by adding the function of mutual linkage between table views and scrolling views, the support of commonly used development platforms for peripherals is enhanced, so that the table view can adapt to the development needs of all-platform games, thereby achieving the purpose of reducing development costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0015] Figure 1 An exemplary flow chart of a scrolling operation method of a table view provided according to some embodiments of the present application;
[0016] Figure 2 An exemplary schematic diagram of determining first size information of a target table view cell when the value of the rotation angle is not empty in a table view scrolling operation method provided according to some embodiments of the present application;
[0017] Figure 3 This is an exemplary flowchart of step S1033 in a scrolling operation method for a table view provided according to some embodiments of the present application when the preset position is an edge;
[0018] Figure 4This is an exemplary flowchart of step S103 in a scrolling operation method for a table view provided according to some embodiments of the present application;
[0019] Figure 5 An exemplary flowchart of steps performed before determining a scroll distance according to the first size information and the second size information to perform a scroll operation on the scroll view according to the scroll distance in a scroll operation method for a table view provided according to some embodiments of the present application;
[0020] Figure 6 An exemplary flowchart of steps performed after performing a scrolling operation on the scroll view according to a target scrolling distance in a scrolling operation method for a table view provided according to some embodiments of the present application;
[0021] Figure 7 This is an exemplary structural diagram of an electronic device provided according to some embodiments of the present application. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] The following terms are used in this article.
[0024] User Interface: UI is a human-computer interaction interface that displays the data inside a computer program on the screen in a graphical form for users to view. It can also receive user input so that users can modify the data inside the program.
[0025] User input: When users interact with the user interface, they usually rely on specific peripherals. Common peripherals include touch screens, keyboards, and controllers.
[0026] View: It is the smallest unit that constitutes the user interface. Everything displayed on the screen is part of the view. Typical views include text paragraphs, buttons, and pictures. These views can receive user input.
[0027] View transformation parameters: a set of parameters used to describe the view position, size and rotation angle.
[0028] Container view: It is a special type of view that can contain multiple views to form a more complex overall view structure. In this structure, the view that contains the subviews is called the parent view, and the contained view is called the subview.
[0029] ScrollView: ScrollView or similar view components are a container view that contains a subview. The size of the subview may exceed the display range of a single screen. Users can input instructions through specific operations to tell the scroll view which part of the subview to view. In this way, the scroll view can adjust the position of the subview according to the user's instructions so that some content that was not originally on the screen can be displayed.
[0030] Table View: TableView or similar view components are a container view that usually contains multiple table view cells. When the application provides a set of data to the table view, the table view automatically creates a series of table view cells based on the data and presents the table view cells in rows and columns for easy viewing and interaction by users. For example, in mobile applications, contact lists, message lists, etc. may be displayed in the form of table views.
[0031] Table view cells, i.e. TableViewCell or similar cell components, are a type of view. Table view cells are generated by and controlled by table views. Generally, the view transformation parameters of the corresponding table view cells can only be queried after the table view cells are rendered.
[0032] Scrolling animation: When the container view adjusts the visible part of the subview, this process is not completed in one go, but is carried out in a gradual approach, which can provide a smoother browsing experience.
[0033] Focus: Focus is a necessary concept when operating the user interface using peripherals such as a joystick and keyboard. Because the operating device is separated from the display device, it is necessary to specify which view has the right to process input. This "authority" to process input is called "focus". Usually, there is only one focus, and it can be moved between different views.
[0034] First embodiment
[0035] The first embodiment of the present application relates to a scrolling operation method for a table view. Figure 1 As shown, the method may include the following steps:
[0036] Step S101, determining first size information of a target table view cell; the target table view cell is used to represent a table view cell that obtains focus among the table view cells of the table view;
[0037] Step S102, determining second size information of the visible range of the scroll view;
[0038] Step S103, determining a scroll distance according to the first size information and the second size information, so as to perform a scrolling operation on the scroll view according to the scroll distance; wherein the scroll distance is used to characterize the alignment of the target table view cell to a preset position of the visible range.
[0039] The method can be applied to a development platform, which can be Unity, iOS, Android, etc., and this embodiment does not specifically limit this. The following is a detailed description of each of the above steps.
[0040] With respect to step S101, specifically, in some examples, each subview in the table view is a table view cell. The table view can provide size information for each table view cell. Exemplarily, the size information may include the height and width of the target table view cell. Among them, when a table view cell of the table view gains focus, the table view cell currently gaining focus can be used as the target table view cell, and then the first size information of the target table view cell is determined. In other words, the target table view cell is the table view cell that the user is currently operating (such as clicking, touching, selecting), or in some cases, the target table view cell is the table view cell that is designated as the current focus by the system or program logic.
[0041] Optionally, in some embodiments, determining the first size information of the target table view cell may include: determining a first bounding rectangle of the target table view cell; and determining the first size information according to the first bounding rectangle.
[0042] For step S102, specifically, in some examples, the second size information of the visible range of the scrolling view can be determined. The visible range refers to the content area that the user can directly see in the scrolling view at a specific moment. The visible range is a rectangle, and the size can be determined by the size of the scrolling view of the visible range and the current scrolling position. For example, in a scrolling view on a mobile phone screen, the visible range is the rectangular area corresponding to the size of the mobile phone screen. If the content of the scrolling view is larger than the visible range, the user can view the content of other parts by scrolling up and down or left and right.
[0043] Optionally, in some embodiments, determining the second size information of the visible range of the scrolling view may include: determining a second circumscribed rectangle of the visible range of the scrolling view; and determining the second size information according to the second circumscribed rectangle.
[0044] For step S103, specifically, in some examples, when the target table view cell is not fully displayed within the visible range of the scrolling view, the scrolling distance can be determined based on the first size information and the second size information, and then a scrolling operation is performed on the scrolling view based on the scrolling distance to align the target table view cell to a preset position in the visible range so that the target table view cell is completely visible.
[0045] It is understandable that in the related art, the table views of some development platforms only support two basic functions of "generating a subview based on given data" and "selecting a subview", which leads to high development costs.
[0046] It is not difficult to find that, compared with the related art, the solution provided by the embodiment of the present application adds the function of mutual linkage between the table view and the scroll view on the basis of the above basic functions. First, by determining the first size information of the target table view cell that obtains the focus in the table view, the first size information is used to characterize the actual space occupied by the target table view cell in the table view layout. Then, the second size information of the current visible range of the scroll view is determined, and the visible range characterizes the boundary of the area directly visible to the user. Finally, the system can automatically calculate the scroll distance based on the first size information and the second size information to align the target table view cell to the preset position of the visible range. It can be understood that the scroll distance is the amount of movement required to completely align the target table view cell to the preset position of the visible range. The scrolling operation on the scroll view based on the scroll distance can ensure that the target table view cell can be properly displayed within the visible range, improving the fluency and efficiency of the user's interaction with the interface. This embodiment is particularly suitable for processing scenarios of data display and scrolling in table views, such as in the interface design of mobile applications that require users to scroll frequently, which can effectively improve the usability of the interface and the accessibility of information. In this embodiment, by adding the function of mutual linkage between the table view and the scroll view, the support of the commonly used development platform for peripherals is enhanced, so that the table view can adapt to the development needs of all platform games, thereby achieving the purpose of reducing development costs.
[0047] Second embodiment
[0048] The second embodiment of the present application relates to a scrolling operation method for a table view. The second embodiment is an improvement on the first embodiment, and the specific improvement is: in the second embodiment of the present application, a specific implementation method for determining the first size information of a target table view cell is provided.
[0049] Specifically, in some embodiments, determining the first size information of the target table view cell, that is, step S101, may include the following steps:
[0050] Step S1011, determining the view transformation parameters of the target table view cell; the view transformation parameters at least include: position, size and rotation angle;
[0051] Step S1012: Determine first size information of a target table view cell according to the view transformation parameter.
[0052] Exemplarily, the first bounding rectangle of the target table view cell may be determined; the position in the view transformation parameter refers to the coordinates of the center point of the first bounding rectangle; the size in the view transformation parameter refers to the length and width of the first bounding rectangle; the rotation angle refers to the angle of rotation of the first bounding rectangle around the center point of the first bounding rectangle. The view transformation parameter is used to determine the final presentation of the target table view cell on the user interface.
[0053] Optionally, in some embodiments, determining the first size information of the target table view cell according to the view transformation parameter, that is, step S1012 may include the following steps:
[0054] Step S10121, determining the rotation condition according to the rotation angle in the image transformation parameters;
[0055] Step S10122: Determine first size information of the target table view cell according to the rotation condition, the position and the size.
[0056] Exemplarily, if the value of the rotation angle is empty, it means that the target table view cell is not rotated, and the first bounding rectangle of the target table view cell is the target table view cell itself. In this case, the first size information is equal to the size information of the target table view cell.
[0057] Exemplarily, if the value of the rotation angle is not empty, it means that the target table view cell is rotated, such as Figure 2 As shown. The first size information of the target table view cell can be calculated according to the trigonometric function, the size information of the target table view cell and the rotation angle. The calculation process can be implemented according to the mathematical principles in the relevant technology, and this embodiment will not be described in detail.
[0058] It is not difficult to find that in an embodiment of the present application, by determining the view transformation parameters of the target table view cell; the view transformation parameters include at least: position, size and rotation angle, and then determining the first size information of the target table view cell according to the view transformation parameters, a specific implementation method for determining the first size information of the target table view cell is provided.
[0059] Third embodiment
[0060] The third embodiment of the present application relates to a scrolling operation method for a table view. The third embodiment is an improvement on the first embodiment, and the specific improvement is: in the third embodiment of the present application, a specific implementation method for determining the scrolling distance according to the first size information and the second size information is provided.
[0061] Optionally, in some embodiments, determining the scroll distance according to the first size information and the second size information may include: determining the scroll distance according to a preset alignment rule, the first circumscribed rectangle, and the second circumscribed rectangle; wherein the preset alignment rule is used to indicate that the target table view cell is aligned to a preset position of the visible range, and the preset position may include one of the following: edge, center, top, bottom, and custom position. In this way, by setting the preset alignment rule as a configurable parameter, a variety of alignment requirements can be met, that is, "aligning the target table view cell to the edge of the visible range", "aligning the target table view cell to the center of the visible range", "aligning the target table view cell to the top of the visible range", "aligning the target table view cell to the bottom of the visible range", and "aligning the target table view cell to a custom position of the visible range". In this way, users can flexibly select the most appropriate alignment rule according to different scenarios and needs.
[0062] It can be understood that similar components used in related technologies still need to configure alignment rules for each interface separately, and cannot use a set of parameters to adapt to most interfaces. Compared with related technologies, the technical solution provided by this embodiment can quickly mass-produce game interfaces that meet the peripheral interaction specifications. These interfaces can automatically adapt to table view units of different sizes, and can meet various layout requirements according to preset alignment rules.
[0063] Optionally, in some embodiments, the step S103 may include the following steps according to the first size information and the second size information:
[0064] Step S1031, according to the arrangement direction of the table view, respectively determine the first end and the second end of the first bounding rectangle of the target table view cell, and the first end and the second end of the second bounding rectangle of the visible range:
[0065] Step S1032, determining a positional relationship between the first circumscribed rectangle and the second circumscribed rectangle according to the first end and the second end of the first circumscribed rectangle and the first end and the second end of the second circumscribed rectangle;
[0066] Step S1033: determining the scrolling distance according to the position relationship.
[0067] In some examples, if the arrangement direction of the table view is vertical, the first end is also the front end and the second end is also the back end; if the arrangement direction of the table view is horizontal, the first end is also the left end and the second end is also the right end.
[0068] Optionally, in some embodiments, the first end and the second end of the first circumscribed rectangle, and the first end and the second end of the second circumscribed rectangle are determined respectively according to the arrangement direction of the table view, that is, step S1031 may include the following steps:
[0069] If the arrangement direction is longitudinal, the first end and the second end of the first circumscribed rectangle are respectively the upper edge and the lower edge of the first circumscribed rectangle; the first end and the second end of the second circumscribed rectangle are respectively the upper edge and the lower edge of the second circumscribed rectangle;
[0070] If the arrangement direction is horizontal, the first end and the second end of the first circumscribed rectangle are respectively the left edge and the right edge of the first circumscribed rectangle; the first end and the second end of the second circumscribed rectangle are respectively the left edge and the right edge of the second circumscribed rectangle.
[0071] In short, when the arrangement direction of the table view is vertical, the first ends of the first circumscribed rectangle and the second circumscribed rectangle are the upper edges of the two, and the second ends are the lower edges of the two. When the arrangement direction of the table view is horizontal, the first ends of the first circumscribed rectangle and the second circumscribed rectangle are the left edges of the two, and the second ends are the right edges of the two.
[0072] Optionally, in some embodiments, determining the positional relationship between the first circumscribed rectangle and the second circumscribed rectangle according to the first end and the second end of the first circumscribed rectangle and the first end and the second end of the second circumscribed rectangle, that is, step S1032 may include the following steps:
[0073] Step S10321, determining a result of approaching the first circumscribed rectangle and the second circumscribed rectangle according to the arrangement direction of the table view, the upper edge of the first circumscribed rectangle, and the upper edge of the second circumscribed rectangle;
[0074] Step S10322: determining a positional relationship between the first circumscribed rectangle and the second circumscribed rectangle according to the approach result, the first end and the second end of the first circumscribed rectangle, and the first end and the second end of the second circumscribed rectangle.
[0075] Optionally, in some embodiments, determining the proximity result of the first circumscribed rectangle and the second circumscribed rectangle according to the arrangement direction of the table view, the upper edge of the first circumscribed rectangle, and the upper edge of the second circumscribed rectangle, that is, step S10321 may include the following steps:
[0076] If the arrangement direction is vertical, then if the data of the first end of the first circumscribed rectangle is greater than the data of the first end of the second circumscribed rectangle, the first circumscribed rectangle is closer to the front than the second circumscribed rectangle;
[0077] If the arrangement direction is horizontal, then if the data of the first end of the first circumscribed rectangle is smaller than the data of the first end of the second circumscribed rectangle, the first circumscribed rectangle is closer to the front than the second circumscribed rectangle.
[0078] In this embodiment, the concepts of "front" and "back" are defined to describe the relative relationship between the edge positions of the first circumscribed rectangle and the second circumscribed rectangle in different arrangement directions. It can be understood that whether it is the first end or the second end of the first circumscribed rectangle, or the first end or the second end of the second circumscribed rectangle, they can all be represented by real numbers, so that they can be compared with each other.
[0079] Exemplarily, if the arrangement direction is vertical, an edge with a higher position in the vertical direction (larger value) is defined as "front". Specifically, if the data of the first end of the first bounding rectangle is greater than the data of the first end of the second bounding rectangle, the first bounding rectangle is front of the second bounding rectangle, that is, the second bounding rectangle is back of the first bounding rectangle.
[0080] For example, if the arrangement direction is horizontal, the edge that is located further to the left in the horizontal direction (with a smaller value) is defined as "front". Specifically, if the data of the first end of the first bounding rectangle is smaller than the data of the first end of the second bounding rectangle, the first bounding rectangle is front of the second bounding rectangle, that is, the second bounding rectangle is back of the first bounding rectangle.
[0081] Optionally, in some embodiments, determining the positional relationship between the first circumscribed rectangle and the second circumscribed rectangle according to the approach result, the first end and the second end of the first circumscribed rectangle, and the first end and the second end of the second circumscribed rectangle, that is, step S10322 may include the following steps:
[0082] determining a first positional relationship according to whether a first end of the first circumscribed rectangle is further back than a second end of the second circumscribed rectangle;
[0083] determining a second positional relationship according to whether the second end of the first circumscribed rectangle is closer to the front than the first end of the second circumscribed rectangle;
[0084] determining a third positional relationship according to whether the second end of the first circumscribed rectangle is further back than the second end of the second circumscribed rectangle;
[0085] A fourth positional relationship is determined according to whether the first end of the first circumscribed rectangle is closer to the front than the first end of the second circumscribed rectangle.
[0086] It should be noted that there is no limitation on the order of the above steps.
[0087] Optionally, in some embodiments, the preset position is an edge; and determining the scrolling distance according to the position relationship, that is, step S1033, may include the following steps:
[0088] Determine a first scrolling distance according to the first position relationship; the first scrolling distance is a position difference between the second end of the first circumscribed rectangle and the second end of the second circumscribed rectangle;
[0089] Determine a second scrolling distance according to the second position relationship; the second scrolling distance is a position difference between a first end of the first circumscribed rectangle and a first end of the second circumscribed rectangle;
[0090] Determine a third scrolling distance according to the third position relationship; the third scrolling distance is a position difference between the second end of the first circumscribed rectangle and the second end of the second circumscribed rectangle;
[0091] A fourth scrolling distance is determined according to the fourth positional relationship; the fourth scrolling distance is a position difference between a first end of the first circumscribed rectangle and a first end of the second circumscribed rectangle.
[0092] For example, see Figure 3As shown, it is possible to first determine whether the first end of the first circumscribed rectangle is behind the second end of the second circumscribed rectangle. If the determination result is yes, it means that the first position relationship is met, and then the scroll distance is determined, and the first scroll distance is used as the scroll distance to perform the scroll operation. Wherein, the first scroll distance can be the difference between the positions of the second end of the first circumscribed rectangle and the second end of the second circumscribed rectangle; if the determination result is no, it means that the first position relationship is not met, and then it is possible to further determine whether the second end of the first circumscribed rectangle is ahead of the first end of the second circumscribed rectangle. If the determination result is yes, it means that the second position relationship is met, and then the second scroll distance is determined, and the second scroll distance is used as the scroll distance to perform the scroll operation. Wherein, the second scroll distance can be the difference between the positions of the first end of the first circumscribed rectangle and the first end of the second circumscribed rectangle; if the determination result is no, it means that the second position relationship is not met, and then it is possible to further determine whether the second end of the first circumscribed rectangle is behind the second end of the second circumscribed rectangle. If the determination result is yes, it means that the third position relationship is met, and then the third scroll distance is determined, and the third scroll distance is used as the scroll distance to perform the scroll operation. The third scrolling distance may be the difference between the second end of the first circumscribed rectangle and the second end of the second circumscribed rectangle; if the determination result is no, it indicates that the third position relationship is not met, and then it can be further determined whether the first end of the first circumscribed rectangle is closer to the front than the first end of the second circumscribed rectangle. If the determination result is yes, it indicates that the fourth position relationship is met, and then the fourth scrolling distance is determined, and the scrolling operation is performed using the fourth scrolling distance as the scrolling distance. The fourth scrolling distance may be the difference between the first end of the first circumscribed rectangle and the first end of the second circumscribed rectangle. If the above determination results are all no, it means that the first circumscribed rectangle is already completely visible inside the second circumscribed rectangle and no scrolling is required.
[0093] It can be seen that in this embodiment, by determining the positions of the first end and the second end of the first circumscribed rectangle and the second circumscribed rectangle, and through a series of conditional judgments, the scrolling distance required to align the target table view cell to the preset position of the visible range is determined. This is conducive to ensuring the correct display of content and improving user experience.
[0094] It can be understood that the above explanation is given by taking the preset position as the edge as an example. As mentioned above, the preset position may also include other positions such as the center. For example, when the preset position is the center, the first end and the second end in this embodiment may be replaced with an intermediate value, and then the above logic is followed to align the target table view cell to the center of the visible range. For other positions such as the top, bottom, and custom positions, they are also processed according to this logic. To avoid redundancy, they will not be described one by one here.
[0095] It should be noted that this embodiment may also be an improvement based on the second embodiment.
[0096] It is not difficult to find that in the embodiment of the present application, by determining the first end and the second end of the first bounding rectangle of the target table view cell and the first end and the second end of the second bounding rectangle of the visible range respectively according to the arrangement direction of the table view, the positional relationship between the first bounding rectangle and the second bounding rectangle is determined according to the first end and the second end of the first bounding rectangle and the first end and the second end of the second bounding rectangle, and then the scrolling distance is determined according to the positional relationship. A specific implementation method for determining the scrolling distance according to the first size information and the second size information is provided. In this embodiment, by determining the endpoints of the bounding rectangle according to the arrangement direction (vertical or horizontal) of the table view, this design fully considers the different layout situations that may occur in reality; based on the clearly defined endpoints of the bounding rectangle, the positional relationship between the first bounding rectangle and the second bounding rectangle can be accurately determined. This accuracy is reflected in the ability to understand the relative positions of the two rectangles in each direction in detail, and then determine the scrolling distance based on the accurate positional relationship, so that the scrolling operation performed on the scroll view according to the scrolling distance can achieve an accurate scrolling effect, which can greatly improve the user experience.
[0097] Fourth embodiment
[0098] The fourth embodiment of the present application relates to a method for scrolling a table view. The fourth embodiment is an improvement on the third embodiment, and the specific improvement is that: in the third embodiment of the present application, the target table view cell can be aligned to the edge of the visible range, which is particularly poor in a mixed layout interface containing table view cells of various sizes; in the fourth embodiment of the present application, the technical solution is further optimized and improved in view of this technical problem.
[0099] Specifically, in some embodiments, the determining of the scroll distance according to the first size information and the second size information, that is, step S103, may also include the following steps: Figure 4 As shown:
[0100] Step S103A, determining first adjacent size information and second adjacent size information in an adjacent table view cell; the adjacent table view cell is used to represent a table view cell adjacent to the target table view cell;
[0101] Step S103B, determining target size information according to the second size information, the first adjacent size information and the second adjacent size information; the target size information is used to represent the target visible range of the scroll view;
[0102] Step S103C: determining a scrolling distance according to the first size information and the target size information.
[0103] For ease of understanding, this embodiment takes the example that the first size information is specifically a first circumscribed rectangle, the second size information is specifically a second circumscribed rectangle, the first adjacent size information is a first adjacent circumscribed rectangle, the second adjacent size information is the second adjacent circumscribed rectangle, and the target size information is a target circumscribed rectangle for exemplary explanation.
[0104] Specifically, in some examples, the table view arranges table view cells according to certain rules, such as 1 row and n columns (1×n), n rows and 1 column (n×1), or m rows and n columns (m×n). Therefore, the table view can determine the adjacent table view cells of the target table view cell. Taking the arrangement of 1 row and n columns (1×n) as an example, the adjacent table view cells can be the table view cells on the left and right sides of the target table view cell. For example, the table view cell on the left side of the target table view cell is the first table view cell X, corresponding to the first adjacent bounding rectangle X1; the table view cell on the right side of the target table view cell is the second table view cell Y, corresponding to the second adjacent bounding rectangle Y1. Exemplarily, the first adjacent bounding rectangle X1 and the second adjacent bounding rectangle Y1 can be determined respectively according to the algorithm logic provided in the second embodiment.
[0105] Optionally, in some embodiments, the target size information is determined based on the second size information, the first adjacent size information and the second adjacent size information, that is, step S103B may include the following steps: determining the target size information based on the size difference between the second size information and the first adjacent size information and the second adjacent size information.
[0106] Specifically, in some examples, assuming that the second bounding rectangle is represented by B, the size of the second bounding rectangle B can be used to subtract the size of the first adjacent bounding rectangle X1 and the size of the second adjacent bounding rectangle Y1 to obtain a size difference B', and the size difference B' is used to characterize the new visible range, that is, the target bounding rectangle. That is, in this example, the second bounding rectangle is the rectangle that needs to be corrected, the first adjacent bounding rectangle X1 is used as the cropping amount of the first end of the target table view cell, and the second adjacent bounding rectangle Y1 is used as the cropping amount of the second end of the target table view cell. By using the size of the second bounding rectangle B and subtracting the size of the first adjacent bounding rectangle X1, the first end of the second bounding rectangle can be moved backward, and the moving distance is the size of the first adjacent bounding rectangle X1 in the moving direction, and the first result is obtained; by subtracting the size of the second adjacent bounding rectangle Y1 from the first result, the first end of the second bounding rectangle can be moved forward, and the moving distance is the size of the second adjacent bounding rectangle Y1 in the moving direction, and the size difference used to characterize the new visible range is obtained.
[0107] In practical applications, the scroll distance can be determined based on the first size information and the target size information. In this way, after alignment, the target table view cell and the edge of the visible range of the scroll view can maintain a distance of the size of a table view cell.
[0108] It should be noted that this embodiment may also be an improvement based on the first embodiment and / or the second embodiment.
[0109] It is not difficult to find that in the embodiment of the present application, the scroll view can query the table view for the size information of the target table view cell and other table view cells adjacent to the target table view cell. Based on this size information, the scroll view can draw a rectangular area that is smaller than the actual visible area, so that the target table view cell is aligned with the rectangular area. In this way, even in an interface with a mixed layout containing table view cells of various sizes, the target table view cell can still maintain a distance of approximately the size of a table view cell from the edge of the visible range, thereby achieving a visually neat alignment effect.
[0110] It can be understood that in the relevant technology, after years of development, console games have formed a set of mature and practical handle operation specifications from both theoretical and practical aspects. Among them, in the handle operation specification, there is a clear guiding principle for scrolling views and table views: when a table view cell of a table view gains focus, if the table view is embedded in a scroll view, the system should let the scroll view scroll the table view to ensure that the table view cell can be fully displayed on the screen. At the same time, the table view cell should maintain a distance of approximately 0.5 to 1 table view cell from the edge of the visible range of the scroll view. Such a design can hint to the user that the table view still has content in this direction, and the user can input instructions to continue to move the focus in this direction to view other content. The content provided by this embodiment can be well matched with the handle operation specification on the mobile terminal.
[0111] Fifth embodiment
[0112] The fifth embodiment of the present application relates to a method for scrolling a table view. The fifth embodiment is an improvement based on the fourth embodiment, and the specific improvement is that in the fourth embodiment, although the distance between the target table view cell and the edge of the visible range can be automatically adjusted, the effect is not ideal when the size of the target table view cell is large. For example, when the visible range can only accommodate 1.5 target table view cells, if a distance of 1 table view cell is reserved at the back end, the target table view cell may not be fully displayed. In the fifth embodiment of the present application, an optimized technical solution is proposed for the situation where the size of the target table view cell is relatively large, or the size of the visible range is relatively small.
[0113] Specifically, in some embodiments, the determining of the first adjacent size information and the second adjacent size information in the adjacent table view cells, step S1031A may include the following steps:
[0114] Step S103A1, determining a first target value of the first adjacent size information according to a control parameter and the first adjacent size information; the control parameter is used to represent a multiple of the distance between the target table view cell and the edge of the visible range;
[0115] Step S103A2, determining a second target value of the second adjacent size information according to the control parameter and the second adjacent size information;
[0116] Correspondingly, determining the target size information according to the second size information, the first adjacent size information and the second adjacent size information is specifically: determining the target size information according to the second size information, the first target value and the second target value.
[0117] That is to say, this embodiment introduces a control parameter R, which is a real number and represents a multiple of the distance between the target table view cell and the edge of the visible range. Exemplarily, the first target value X2 = first adjacent size information (such as the first adjacent bounding rectangle X1) × R, the second target value Y2 = second adjacent size information (such as the second adjacent bounding rectangle Y1) × R, and then the first target value X2 and the second target value Y2 are used to replace the first adjacent size information (such as the first adjacent bounding rectangle X1) and the second adjacent size information (such as the second adjacent bounding rectangle Y1) in step S103B. In this way, the purpose of controlling the distance between the target table view cell and the edge of the visible range by adjusting the control parameter R can be achieved.
[0118] For example, when only 1.5 target table view cells can be accommodated in the visible range, the control parameter R can be set to 0.2, so that the complete display of the target table view cells can be guaranteed.
[0119] It should be noted that this embodiment may also be an improvement based on any one or more of the first to third embodiments.
[0120] It is not difficult to find that in the embodiment of the present application, the first target value of the first adjacent size information is determined according to the control parameter and the first adjacent size information; the control parameter is used to characterize the multiple of the distance between the target table view cell and the edge of the visible range; the second target value of the second adjacent size information is determined according to the control parameter and the second adjacent size information, and then the target size information is determined according to the second size information, the first target value and the second target value. By introducing the control parameter, the distance between the target table view cell and the edge of the visible range can be flexibly set, and the distance can be the size of 1 table view cell or the size of 0.5 table view cells. Doing so can effectively imply that there is more content to explore in the user interface, while also gaining a larger display space for the target table view cell.
[0121] Sixth embodiment
[0122] The sixth embodiment of the present application relates to a method for scrolling a table view. The sixth embodiment is an improvement based on the first embodiment, and the specific improvement is that: in the first embodiment, since the scroll view will not render table view cells outside the visible range, the target table view cells outside the visible range cannot be rendered, and the specific position and size of the target table view cells that are not rendered cannot be directly obtained. Therefore, the effect of performing a scrolling operation on the scroll view according to the scrolling distance is not good. In order to solve this problem, the sixth embodiment of the present application provides an improved solution, which aims to gradually correct the scrolling distance during the execution of the scrolling operation.
[0123] Specifically, in some embodiments, before determining the scrolling distance according to the first size information and the second size information to perform a scrolling operation on the scroll view according to the scrolling distance, the method may further include the following steps: Figure 5 As shown:
[0124] Step S201, determining whether the target table view cell is rendered;
[0125] Step S202, if the target table view cell has been rendered, determining a scroll distance according to the first size information and the second size information, so as to perform a scroll operation on the scroll view according to the scroll distance;
[0126] Step S203: otherwise, determine a correction strategy according to the rendering status of each table view cell in the table view; the correction strategy is used to perform a scrolling operation on the scroll view according to the target scrolling distance before the target table view cell enters the visible range.
[0127] Specifically, in some examples, each table view cell has a unique serial number (usually an integer that increases from 0) for identifying the position of the table view cell in the table view. Therefore, the target table view cell can be determined by querying the serial number of the table view.
[0128] Further, in some examples, it is determined whether the target table view cell is rendered. That is, whether the target table view cell is within the visible range. If the target table view cell has been rendered, step S103 can be performed, otherwise, if the target table view cell has not been rendered, it means that the target table view cell has not entered the visible range, and a correction strategy can be determined according to the rendering status of each table view cell in the table view.
[0129] Optionally, in some embodiments, determining the correction strategy according to the rendering state of each table view cell in the table view, that is, step S203 may include the following steps:
[0130] Step S2031, determining each table view cell that has been rendered in the table view;
[0131] Step S2032, determining a table view cell object in the table view; the table view cell object is used to represent a table view cell that is closer to the target table view cell among the first table view cell and the last table view cell of the rendered table view cells;
[0132] Step S2033: Determine the target scrolling distance according to the table view cells, the target table view cell and the table view cell object, so as to determine a correction strategy according to the target scrolling distance.
[0133] Specifically, in some examples, all table view cells that have been rendered in the table view may be traversed based on the current frame to obtain each table view cell that has been rendered in the table view.
[0134] Specifically, in some examples, the first serial number of the first table view cell and the second serial number of the last table view cell among all the table view cells currently being rendered can be determined. Then, the first serial number and the second serial number can be compared with the serial number of the target table view cell, respectively, to calculate the first difference between the serial number of the target table view cell and the first serial number, and the second difference between the serial number of the target table view cell and the second serial number. The first difference is used to characterize the position interval between the target table view cell and the first table view cell, and the second difference is used to characterize the position interval between the target table view cell and the last table view cell. Further, by comparing the size of the first difference and the second difference, it can be determined which rendered table view cell is closer to the target table view cell. If the first difference is smaller, then the first table view cell is the table view cell closer to the target table view cell; conversely, if the second difference is smaller, then the last table view cell is the table view cell closer to the target table view cell. The table view cell closer to the target table view cell is used as the table view cell object.
[0135] Optionally, in some embodiments, determining the target scroll distance according to the table view cells, the target table view cell and the table view cell object, that is, step S2033 may include the following steps:
[0136] Step S20331, determining the average value of each bounding rectangle corresponding to each rendered table view cell;
[0137] Step S20332, determining the position interval between the target table view cell and the table view cell object;
[0138] Step S20333: determine a target scrolling distance according to the average value and the position interval.
[0139] Specifically, in some examples, the sizes of the bounding rectangles of all currently rendered table view cells may be traversed first to calculate the average value. Exemplarily, the average value is recorded as Size.
[0140] Specifically, in some examples, the position interval can be determined according to the difference between the serial numbers of the target table view cell and the table view cell object, or according to the vertical or horizontal pixel difference between the display positions of the target table view cell and the table view cell object on the screen, which is not specifically limited in this embodiment. For example, assuming that the serial number of the target table view cell is 10 and the serial number of the table view cell object is 7, the difference between the serial numbers is 10-7=3.
[0141] Optionally, in some embodiments, determining the target scroll distance according to the average value and the position interval, that is, step S20333, may include the following steps:
[0142] Step S203331, determining a distance estimation value according to the average value and the position interval;
[0143] Step S203332: determine the target scrolling distance according to the distance estimation value.
[0144] Specifically, in some examples, the difference in the serial numbers used to characterize the position intervals can be further multiplied by the average value Size, because the average value of each table view cell is known, and multiplying by the difference in the serial numbers is equivalent to accumulating the sizes of the table view cells of these intervals, thereby obtaining a relatively accurate estimated distance required to scroll from the table view cell object to the target table view cell. The estimated distance is recorded as Distance.
[0145] Specifically, in some examples, a target scrolling distance smaller than the estimated distance value can be selected for scrolling. In this way, by adopting a step-by-step approach, the target table view cell can be scrolled to the appropriate position more accurately through multiple small-step scrollings, and the user can also see the scrolling process, making the interface interaction smoother and more natural. For example, if the estimated distance value Distance is 100 pixels, you can scroll only 50 pixels (target scrolling distance) each time, and then check the position of the target table view cell, and then scroll again according to the situation, until the target table view cell completely enters the visible range and reaches the specified position.
[0146] It should be noted that this embodiment may also be an improvement based on any one or more of the second to fifth embodiments.
[0147] It can be understood that in the related technology, considering that the table view usually needs to display a lot of content, it is usually necessary to support the cropping and reuse mechanism of the table view cells. That is, the table view does not render all the table view cells, but only renders the visible part. This can reduce rendering overhead and improve performance. At the same time, when the table view cell moves out of the visible range, the table view cell will be recycled; and when the user scrolls the table view so that new table view cells need to be displayed on the screen, those previously recycled table view cells are reused instead of creating new table view cells each time. Therefore, the target table view cells outside the visible range cannot be rendered, and the specific position and size of the target table view cells that are not rendered cannot be directly obtained. Therefore, the effect of scrolling the scroll view according to the scroll distance is not good.
[0148] It is not difficult to find that in the embodiment of the present application, an algorithm process is provided for making the target table view cell enter the visible range by gradually scrolling. By continuously judging the rendering status of each table view cell in the table view, a correction strategy is determined according to the rendering status of each table view cell in the table view; the correction strategy is used to perform a scrolling operation on the scroll view according to the target scrolling distance before the target table view cell enters the visible range. In this embodiment, even if the specific size of the target table view cell is unknown, the table view can still be scrolled to achieve the purpose of scrolling the target cell to the specified position, and the function of adding a scrolling animation in the process of performing a scrolling operation on the scroll view according to the scrolling distance is realized, so that the positioning process of the table view becomes smoother, thereby providing a better user experience and better effect.
[0149] Seventh embodiment
[0150] The seventh embodiment of the present application relates to a method for scrolling a table view. The seventh embodiment is an improvement on the sixth embodiment, and the specific improvement is that: in the seventh embodiment of the present application, as the scrolling proceeds, more and more table view cells will enter the visible range, and the remaining scrolling distance can be corrected according to the actual size and average value of the table view cells that have newly entered the visible range; this process will continue until the target cell is scrolled to the specified position.
[0151] Specifically, in some embodiments, after performing a scrolling operation on the scroll view according to the target scrolling distance, the method may further include the following steps: Figure 6 As shown:
[0152] Step S301, determining whether the target table view cell is rendered in the next frame;
[0153] Step S302, if the target table view cell is rendered, the first size information and the second size information are used to determine a scroll distance, so as to perform a scroll operation on the scroll view according to the scroll distance;
[0154] Step S303: otherwise, determining whether there is a table view cell in each table view cell of the table view that has changed from an unrendered state to a rendered state;
[0155] Step S304: adjusting the target scrolling distance according to the determination result.
[0156] Specifically, in some examples, it can be determined whether the target table view cell is rendered in the next frame, that is, whether it is already in the visible range. If so, since the size of the target table view cell is known, the scroll view continues to be scrolled according to the scroll distance in each frame until the target table view cell is scrolled to the specified position, and the process ends. Otherwise, it is determined whether there are table view cells in the table view that have changed from an unrendered state to a rendered state, and the target scroll distance is adjusted according to the determination result.
[0157] Optionally, in some embodiments, adjusting the target scrolling distance according to the determination result, that is, step S304, may include the following steps:
[0158] Step S3041, if there is no table view cell that has changed from an unrendered state to a rendered state, then continue to perform the step of performing a scrolling operation on the scroll view according to the target scrolling distance;
[0159] Step S3042: otherwise, determine a set of table view cells that have changed from an unrendered state to a rendered state;
[0160] Step S3043: adjust the target scroll distance according to the table view cell set.
[0161] Specifically, in some examples, if there is no table view cell that has changed from an unrendered state to a rendered state, the step of performing a scrolling operation on the scroll view according to the target scroll distance is continued. Otherwise, if there is a table view cell that has changed from an unrendered state to a rendered state, a table view cell set of table view cells that have changed from an unrendered state to a rendered state is further determined, and the table view cell set is recorded as Z. Then, according to the table view cell set Z, the distance estimation value is adjusted to Distance, and then the target scroll distance is adjusted.
[0162] Optionally, in some embodiments, adjusting the target scroll distance according to the table view cell set, that is, step S3043, may include the following steps:
[0163] Step S30431, traversing each table view cell in the table view cell set; wherein, during the traversal process, determining the size information of each table view cell, and adjusting the distance estimate value according to the size information and the average value to obtain an updated distance estimate value;
[0164] Step S30432: after the traversal is completed, an updated target scrolling distance is determined according to the updated distance estimation value, so as to perform a scrolling operation on the scrolling view according to the updated target scrolling distance.
[0165] Specifically, in some examples, each table view cell in the table view cell set Z can be traversed to determine whether the traversal of the set Z is completed; if the determination result is no, the size of the bounding rectangle of the table view cell currently traversed is determined, recorded as XSize, and the distance estimation value is adjusted according to the size information of each table view cell and the average value, and then the target scroll distance is adjusted according to the updated distance estimation value. After the traversal is completed, the scroll view can be scrolled according to the updated target scroll distance.
[0166] Optionally, in some embodiments, adjusting the distance estimation value according to the size information and the average value, that is, step S30431 may include the following steps:
[0167] Step S304311, determining the difference between the distance estimation value and the average value;
[0168] Step S304312, determine the sum of the difference and the size information to obtain an updated distance estimate.
[0169] Specifically, in some examples, the updated distance estimate Distance′ is made equal to the distance Distance−the average value Size+the bounding rectangle size XSize of the currently traversed table view cell.
[0170] It should be noted that this embodiment may also be an improvement based on any one or more of the first to fifth embodiments.
[0171] It is not difficult to find that in the embodiment of the present application, as the scrolling proceeds, more and more table view cells will enter the visible range, and the remaining scrolling distance can be corrected according to the actual size and average value of the table view cells newly entering the visible range; this process will continue until the target cell scrolls to the specified position.
[0172] The step division of the above methods is only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this application; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this application.
[0173] Eighth embodiment
[0174] The eighth embodiment of the present application provides an electronic device. The electronic device may be a digital computer in various forms, such as a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, etc. The electronic device may also be a mobile device in various forms, such as a personal digital processing, a cellular phone, a smart phone, a wearable device, and other similar computing devices.
[0175] The electronic device includes: one or more processors; and a memory storing computer program instructions, wherein when the computer program instructions are executed, the processor executes the steps of the method provided in any one or more of the above embodiments. Figure 7 An exemplary structural diagram of the electronic device is disclosed. Figure 7As shown, the electronic device includes: one or more processors 1101, memory 1102, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Among them, the components shown in this article, their connections and relationships, and their functions are only used as examples, and are not intended to limit the implementation of the present application described and / or required herein.
[0176] The electronic device may further include: an input device 1103 and an output device 1104. The processor 1101, the memory 1102, the input device 1103 and the output device 1104 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0177] The input device 1103 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a track ball, a joystick and other input devices. The output device 1104 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.
[0178] To provide interaction with a user, the electronic device may be a computer. The computer has: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball), through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0179] In the embodiments of the present application, a computer program / instruction is stored on a computer-readable medium, and when the computer program / instruction is executed by a processor, the steps of the method provided by any one or more of the above embodiments are implemented. The computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more computer-readable instructions.
[0180] The memory 1102 can be used as a non-transient computer-readable storage medium, which can be used to store non-transient software programs, non-transient computer executable programs and modules. The processor 1101 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 1102, so as to implement the program instructions / modules corresponding to the method provided by any one or more embodiments in the embodiments of the present application.
[0181] The memory 1102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 1102 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1102 may optionally include a memory remotely arranged relative to the processor 1101, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0182] It should be noted that the computer-readable medium described in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.
[0183] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0184] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0185] In the above-described embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. For example, it can be implemented by using an application specific integrated circuit (ASIC), a general-purpose computer or any other similar hardware device. In certain embodiments, the software program of the present application can be executed by a processor to implement the above steps or functions. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented by hardware, for example, as a circuit that cooperates with a processor to perform each step or function.
[0186] The computer program product provided in the embodiment of the present application includes one or more computer programs / instructions, and when the computer program / instructions are executed by the processor, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from a computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0187] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0188] The scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes that fall within the meaning and scope of the equivalent elements of the claims are included in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim may also be implemented by one unit or device through software or hardware. The words "first", "second", etc. are only used to distinguish the description, and do not indicate any particular order, nor can they be understood as indicating or implying relative importance.
[0189] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims, and the above embodiments should be regarded as exemplary and non-restrictive.
Claims
1. A scrolling operation method for a table view, characterized in that: The method comprises: Determine first size information of a target table view cell; the target table view cell is used to represent a table view cell that obtains focus among the table view cells of the table view; Determine the second size information of the visible range of the scroll view; A scroll distance is determined according to the first size information and the second size information, so as to perform a scrolling operation on the scroll view according to the scroll distance; wherein the scroll distance is used to characterize the alignment of the target table view cell to a preset position of the visible range.
2. The method according to claim 1, characterized in that Determine the first size information of the target table view cell including: Determine the first bounding rectangle of the target table view cell; The first size information is determined according to the first circumscribed rectangle.
3. The method according to claim 1, characterized in that Determining the first size information of the target table view cell includes: Determining view transformation parameters of the target table view cell; the view transformation parameters include at least: position, size and rotation angle; Determine first size information of a target table view cell according to the view transformation parameter.
4. The method according to claim 3, characterized in that The determining, according to the view transformation parameter, first size information of the target table view cell comprises: Determining a rotation condition according to a rotation angle in the image transformation parameters; Determine first size information of a target table view cell according to the rotation condition, the position and the size.
5. The method according to claim 1, characterized in that The second size information for determining the visible range of the scroll view includes: Determine the second bounding rectangle of the visible range of the scroll view; The second size information is determined according to the second circumscribed rectangle.
6. The method according to claim 1, characterized in that The determining the scroll distance according to the first size information and the second size information includes: The scroll distance is determined according to a preset alignment rule, the first size information and the second size information; wherein the preset alignment rule is used to indicate that the target table view cell is aligned to a preset position of the visible range, and the preset position includes one of the following: edge, center, top, bottom and custom position.
7. The method according to claim 6, characterized in that The determining the scroll distance according to the first size information and the second size information includes: According to the arrangement direction of the table view, determine the first end and the second end of the first circumscribed rectangle of the target table view cell, and the first end and the second end of the second circumscribed rectangle of the visible range respectively; Determine a positional relationship between the first circumscribed rectangle and the second circumscribed rectangle according to the first end and the second end of the first circumscribed rectangle and the first end and the second end of the second circumscribed rectangle; The scroll distance is determined according to the positional relationship.
8. The method according to claim 7, characterized in that The determining, according to the arrangement direction of the table view, the first end and the second end of the first bounding rectangle of the target table view cell, and the first end and the second end of the second bounding rectangle of the visible range respectively comprises: If the arrangement direction is longitudinal, the first end and the second end of the first circumscribed rectangle are respectively the upper edge and the lower edge of the first circumscribed rectangle; the first end and the second end of the second circumscribed rectangle are respectively the upper edge and the lower edge of the second circumscribed rectangle; If the arrangement direction is horizontal, the first end and the second end of the first circumscribed rectangle are respectively the left edge and the right edge of the first circumscribed rectangle; the first end and the second end of the second circumscribed rectangle are respectively the left edge and the right edge of the second circumscribed rectangle.
9. The method according to claim 8, characterized in that Determining the positional relationship between the first circumscribed rectangle and the second circumscribed rectangle according to the first end and the second end of the first circumscribed rectangle and the first end and the second end of the second circumscribed rectangle includes: Determine, according to the arrangement direction of the table view, the upper edge of the first circumscribed rectangle and the upper edge of the second circumscribed rectangle, a result of approaching the first circumscribed rectangle and the second circumscribed rectangle; A positional relationship between the first circumscribed rectangle and the second circumscribed rectangle is determined according to the approach result, the first end and the second end of the first circumscribed rectangle, and the first end and the second end of the second circumscribed rectangle.
10. The method according to claim 9, characterized in that The determining, according to the arrangement direction of the table view, the upper edge of the first circumscribed rectangle and the upper edge of the second circumscribed rectangle, a result of proximity between the first circumscribed rectangle and the second circumscribed rectangle comprises: If the arrangement direction is vertical, then if the data of the upper edge of the first circumscribed rectangle is greater than the data of the upper edge of the second circumscribed rectangle, the first circumscribed rectangle is closer to the front than the second circumscribed rectangle; If the arrangement direction is horizontal, then if the data of the upper edge of the first circumscribed rectangle is smaller than the data of the upper edge of the second circumscribed rectangle, the first circumscribed rectangle is located in front of the second circumscribed rectangle.
11. The method according to claim 10, characterized in that Determining the positional relationship between the first circumscribed rectangle and the second circumscribed rectangle according to the approach result, the first end and the second end of the first circumscribed rectangle, and the first end and the second end of the second circumscribed rectangle comprises: determining a first positional relationship according to whether a first end of the first circumscribed rectangle is further back than a second end of the second circumscribed rectangle; determining a second positional relationship according to whether the second end of the first circumscribed rectangle is closer to the front than the first end of the second circumscribed rectangle; determining a third positional relationship according to whether the second end of the first circumscribed rectangle is further back than the second end of the second circumscribed rectangle; A fourth positional relationship is determined according to whether the first end of the first circumscribed rectangle is closer to the front than the first end of the second circumscribed rectangle.
12. The method according to claim 11, characterized in that The preset position is an edge; and determining the scrolling distance according to the position relationship includes: Determine a first scrolling distance according to the first position relationship; the first scrolling distance is a position difference between the second end of the first circumscribed rectangle and the second end of the second circumscribed rectangle; Determine a second scrolling distance according to the second position relationship; the second scrolling distance is a position difference between a first end of the first circumscribed rectangle and a first end of the second circumscribed rectangle; Determine a third scrolling distance according to the third position relationship; the third scrolling distance is a position difference between the second end of the first circumscribed rectangle and the second end of the second circumscribed rectangle; A fourth scrolling distance is determined according to the fourth position relationship; the third scrolling distance is a position difference between a first end of the first circumscribed rectangle and a first end of the second circumscribed rectangle.
13. The method according to any one of claims 1 to 12, characterized in that The determining the scroll distance according to the first size information and the second size information includes: Determine first adjacent size information and second adjacent size information in an adjacent table view cell; the adjacent table view cell is used to represent a table view cell adjacent to the target table view cell; Determine target size information according to the second size information, the first adjacent size information, and the second adjacent size information; the target size information is used to characterize a target visible range of the scroll view; A scroll distance is determined according to the first size information and the target size information.
14. The method according to claim 13, characterized in that The determining the target size information according to the second size information, the first adjacent size information, and the second adjacent size information includes: Target size information is determined according to a size difference between the second size information and the first adjacent size information and the second adjacent size information.
15. The method according to claim 14, characterized in that Determining first adjacent size information and second adjacent size information in adjacent table view cells includes: Determining a first target value of the first adjacent size information according to a control parameter and the first adjacent size information; the control parameter is used to represent a multiple of a distance between the target table view cell and an edge of the visible range; Determining a second target value of the second adjacent size information according to the control parameter and the second adjacent size information; Correspondingly, determining the target size information according to the second size information, the first adjacent size information and the second adjacent size information is specifically: determining the target size information according to the second size information, the first target value and the second target value.
16. The method according to any one of claims 1 to 12, characterized in that Before determining a scroll distance according to the first size information and the second size information to perform a scroll operation on the scroll view according to the scroll distance, the method further includes: Determining whether the target table view cell is rendered; If the target table view cell has been rendered, determining a scroll distance according to the first size information and the second size information, so as to perform a scroll operation on the scroll view according to the scroll distance; Otherwise, a correction strategy is determined according to the rendering status of each table view cell in the table view; the correction strategy is used to perform a scrolling operation on the scroll view according to the target scrolling distance before the target table view cell enters the visible range.
17. The method according to claim 16, characterized in that Determining the correction strategy according to the rendering state of each table view cell in the table view includes: Determining each table view cell that has been rendered in the table view; Determine a table view cell object in the table view; the table view cell object is used to represent a table view cell that is closer to the target table view cell among the first table view cell and the last table view cell of the rendered table view cells; The target scroll distance is determined according to the table view cells, the target table view cell and the table view cell object, so as to determine a correction strategy according to the target scroll distance.
18. The method according to claim 17, characterized in that The determining the target scroll distance according to the table view cells, the target table view cell, and the table view cell object comprises: Determine the average value of each size information corresponding to each rendered table view cell; Determine the position interval between the target table view cell and the table view cell object; A target scroll distance is determined according to the average value and the position interval.
19. The method according to claim 18, characterized in that Determining the target scroll distance according to the average value and the position interval includes: determining a distance estimate based on the average value and the position interval; The target scroll distance is determined according to the distance estimation value.
20. The method according to claim 19, characterized in that After performing a scrolling operation on the scroll view according to the target scrolling distance, the method further includes: Determine whether the target table view cell is rendered in the next frame; If the target table view cell is rendered, determining a scroll distance according to the first size information and the second size information, so as to perform a scroll operation on the scroll view according to the scroll distance; Otherwise, determining whether there is a table view cell in each table view cell of the table view that has changed from a non-rendered state to a rendered state; According to the determination result, the target scrolling distance is adjusted.
21. The method according to claim 20, characterized in that The adjusting the target scrolling distance according to the determination result includes: If there is no table view cell that has changed from an unrendered state to a rendered state, continuing to perform the step of performing a scrolling operation on the scroll view according to the target scroll distance; Otherwise, determine the table view cell set of table view cells that have changed from an unrendered state to a rendered state; The target scroll distance is adjusted based on the set of table view cells.
22. The method according to claim 21, characterized in that The adjusting the target scroll distance according to the table view cell set includes: Traversing each table view cell in the table view cell set; wherein, during the traversal process, determining the size information of each table view cell, and adjusting the distance estimate value according to the size information and the average value to obtain an updated distance estimate value; After the traversal is completed, an updated target scrolling distance is determined according to the updated distance estimation value, so as to perform a scrolling operation on the scroll view according to the updated target scrolling distance.
23. The method according to claim 22, characterized in that The adjusting the distance estimation value according to the size information and the average value comprises: determining a difference between the distance estimate and the average; A sum of the difference and the size information is determined to obtain an updated distance estimate.
24. An electronic device, characterized in that: The electronic device comprises: one or more processors; and A memory storing computer program instructions which, when executed, cause the processor to perform the steps of the method as claimed in any one of claims 1 to 23.
25. A computer readable medium having a computer program / instructions stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 23 are implemented.
26. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method described in any one of claims 1 to 23 are implemented.