TW201913351A - Layout method and device for view component - Google Patents

Layout method and device for view component Download PDF

Info

Publication number
TW201913351A
TW201913351A TW107125844A TW107125844A TW201913351A TW 201913351 A TW201913351 A TW 201913351A TW 107125844 A TW107125844 A TW 107125844A TW 107125844 A TW107125844 A TW 107125844A TW 201913351 A TW201913351 A TW 201913351A
Authority
TW
Taiwan
Prior art keywords
view component
layout
state
touched
view
Prior art date
Application number
TW107125844A
Other languages
Chinese (zh)
Inventor
胡月輝
吳德彬
陸東鑫
劉世君
王成文
倪順堅
李星
汪震
史兵兵
Original Assignee
香港商阿里巴巴集團服務有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 香港商阿里巴巴集團服務有限公司 filed Critical 香港商阿里巴巴集團服務有限公司
Publication of TW201913351A publication Critical patent/TW201913351A/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs

Abstract

Disclosed are a layout method and device for a view component, comprising: determining a first view component and a second view component included in a layout container; loading and displaying the first view component and the second view component, wherein the first view component and the second view component are in a stacked layout. That is to say, the technical solution provided by the embodiment of the present application can effectively realize the stacked layout between different view components in a layout container, thereby effectively improving the visual effect of a user, and increasing the compactness among different view components compared with a tiled layout. When a certain attribute of a product object is displayed, the user can quickly determine the difference, enhancing the user experience of the product object.

Description

視圖組件的佈局方法及設備View component layout method and device

本案涉及網際網路信息處理技術領域以及計算機技術領域,尤其涉及一種視圖組件的佈局方法及設備。The present invention relates to the field of Internet information processing technology and computer technology, and in particular, to a layout method and device for a view component.

客戶端的用戶界面(User Interface,UI)是用戶與客戶端進行互動時,用戶操作的對象。UI是由視圖組件(view)組成的,客戶端根據不同的佈局邏輯對UI中的view進行佈局,可以實現不同的佈局樣式。   目前,常見的佈局樣式是平舖樣式。如圖1所示,為現有技術中常見的平舖樣式的示意圖。從圖1中可以看出,UI中的視圖組件採用水平線性佈局方式(視圖組件1與視圖組件2、視圖組件3與視圖組件4、視圖組件5與視圖組件6)/垂直線性佈局方式(視圖組件1、視圖組件3與視圖組件5;視圖組件2、視圖組件4與視圖組件6)排列。   但是,在透過視圖組件展示商品對象的某種屬性時,採用這種佈局樣式,使用戶的視覺體驗較差,無法較好的選擇商品對象,降低用戶對商品對象的用戶體驗。The client's user interface (UI) is the object that the user operates when the user interacts with the client. The UI is composed of view components. The client layouts the views in the UI according to different layout logics, and different layout styles can be implemented. Currently, the common layout style is tiled. As shown in Figure 1, it is a schematic diagram of a tile pattern that is common in the prior art. As can be seen from Figure 1, the view components in the UI adopt a horizontal linear layout (view component 1 and view component 2, view component 3 and view component 4, view component 5 and view component 6) / vertical linear layout (view The components 1, the view component 3 and the view component 5; the view component 2, the view component 4 and the view component 6) are arranged. However, when displaying certain attributes of the product object through the view component, the layout style is adopted to make the user's visual experience worse, and the product object cannot be selected well, and the user experience of the product object is reduced.

有鑒於此,本案實施例提供了一種視圖組件的佈局方法及設備,用於解決現有技術中平舖樣式存在的用戶的視覺體驗較差的問題。   本案實施例採用下述技術方案:   本案實施例提供一種視圖組件的佈局方法,包括:   確定佈局容器中包含的第一視圖組件和第二視圖組件;   加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。   本案實施例還提供一種視圖組件的佈局方法,包括:   確定佈局容器中包含的第一視圖組件和第二視圖組件,所述第一視圖組件與所述第二視圖組件之間的間隔為負值;   加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。   本案實施例還提供一種視圖組件的佈局方法,包括:   確定佈局容器中包含的第一視圖組件和第二視圖組件,所述第一視圖組件和所述第二視圖組件上按照設定路徑創建蒙層;   加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。   本案實施例還提供了一種視圖組件的佈局設備,包括:   確定單元,確定佈局容器中包含的第一視圖組件和第二視圖組件;   處理單元,加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。   本案實施例還提供了一種視圖組件的佈局設備,包括:   確定單元,確定佈局容器中包含的第一視圖組件和第二視圖組件,所述第一視圖組件與所述第二視圖組件之間的間隔為負值;   處理單元,加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。   本案實施例還提供了一種視圖組件的佈局設備,包括:   確定單元,確定佈局容器中包含的第一視圖組件和第二視圖組件,所述第一視圖組件和所述第二視圖組件上按照設定路徑創建蒙層;   處理單元,加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。   本案實施例採用的上述至少一個技術方案能夠達到以下有益效果:   透過確定佈局容器中包含的第一視圖組件和第二視圖組件;加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。也就是說,透過本案實施例提供的技術方案能夠有效實現佈局容器中的不同視圖組件之間呈層疊式佈局,有效提高了用戶的視覺效果,與平舖佈局相比,增加了不同視圖組件之間的緊湊性,在展示商品對象的某種屬性時,使得用戶能夠快速確定其區別,提升用戶對商品對象的用戶體驗。In view of this, the embodiment of the present invention provides a method and a device for laying out a view component, which are used to solve the problem that a user's visual experience is poor in the tile style in the prior art. The embodiment of the present invention adopts the following technical solution: The embodiment of the present invention provides a layout method of a view component, including: determining a first view component and a second view component included in a layout container; loading and displaying the first view component and the first A two-view component, the first view component and the second view component being in a stacked layout. The embodiment of the present invention further provides a layout method of the view component, comprising: determining a first view component and a second view component included in the layout container, wherein a gap between the first view component and the second view component is a negative value Loading displays the first view component and the second view component, the first view component and the second view component being in a stacked layout. The embodiment of the present invention further provides a layout method of a view component, including: determining a first view component and a second view component included in a layout container, wherein the first view component and the second view component create a mask according to a set path Loading displays the first view component and the second view component, the first view component and the second view component being in a stacked layout. The embodiment of the present invention further provides a layout device of a view component, comprising: a determining unit, determining a first view component and a second view component included in the layout container; a processing unit, loading and displaying the first view component and the second A view component, the first view component and the second view component being in a stacked layout. The embodiment of the present invention further provides a layout device of a view component, including: a determining unit, determining a first view component and a second view component included in the layout container, between the first view component and the second view component The interval is a negative value; the processing unit loads and displays the first view component and the second view component, and the first view component and the second view component are in a stacked layout. The embodiment of the present invention further provides a layout device of a view component, including: a determining unit, determining a first view component and a second view component included in the layout container, and setting the first view component and the second view component according to the setting a path creation mask; a processing unit that loads and displays the first view component and the second view component, the first view component and the second view component being in a stacked layout. The at least one technical solution adopted by the embodiment of the present invention can achieve the following beneficial effects: by determining a first view component and a second view component included in the layout container; loading and displaying the first view component and the second view component, The first view component and the second view component are in a stacked layout. That is to say, the technical solution provided by the embodiment of the present invention can effectively realize the cascading layout between different view components in the layout container, thereby effectively improving the visual effect of the user, and adding different view components compared with the tile layout. The compactness of the product, when displaying certain attributes of the product object, enables the user to quickly determine the difference and enhance the user experience of the product object.

為了實現本案的目的,本案實施例提供了一種視圖組件的佈局方法及設備,透過確定佈局容器中包含的第一視圖組件和第二視圖組件;加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。也就是說,透過本案實施例提供的技術方案能夠有效實現佈局容器中的不同視圖組件之間呈層疊式佈局,有效提高了用戶的視覺效果,與平舖佈局相比,增加了不同視圖組件之間的緊湊性,在展示商品對象的某種屬性時,使得用戶能夠快速確定其區別,提升用戶對商品對象的用戶體驗。   需要說明的是,本案實施例中所記載的佈局容器可以理解為視圖組件的集合,在佈局容器中包含了多個視圖組件,並且佈局容器中包含這些視圖組件的佈局邏輯,這裡的佈局邏輯包含視圖組件的排列順序(例如:線性排列等等),不同視圖組件之間的相對位置關係,等等。透過佈局控制器可以實現對佈局容器中包含的視圖組件的佈局。   為使本案的目的、技術方案和優點更加清楚,下面將結合本案具體實施例及相應的附圖對本案技術方案進行清楚、完整地描述。顯然,所描述的實施例僅是本案一部分實施例,而不是全部的實施例。基於本案中的實施例,本領域普通技術人員在沒有做出創造性勞動前提下所獲得的所有其他實施例,都屬於本案保護的範圍。   以下結合附圖,詳細說明本案各實施例提供的技術方案。   圖2為本案實施例提供的一種視圖組件的佈局方法的流程示意圖。所述方法可以如下所示。   步驟201:確定佈局容器中包含的第一視圖組件和第二視圖組件。   在本案實施例中,在確定佈局容器中包含的第一視圖組件和第二視圖組件之前,所述方法還包括:   繪製第一視圖組件和第二視圖組件。   由於作業系統不同,那麼繪製視圖組件的方式不同。這裡以作業系統為Android作業系統和iOS作業系統為例分別進行說明。   下面以作業系統為Android作業系統為例說明如何繪製得到第一視圖組件和第二視圖組件的。   首先,繪製第一視圖組件的邊框和第二視圖組件的邊框。   在本案實施例中第一視圖組件和第二視圖組件的邊框可以是規則形狀,也可以是不規則形狀,這裡不做具體限定。   以不規則形狀為例繪製得到視圖組件的邊框。第一步,初始化視圖組件的寬度值、高度值、四周圓角的半徑值,設置邊框畫筆Paint、顏色畫筆Paint(這裡包含設置去鋸齒、空心等參數)。   第二步,創建邊框繪製路徑Path、顏色繪製路徑Path。   繪製路徑Path起點為繪製矩形的左上角圓弧,繪製順序為:繪製矩形左上角的圓弧、繪製凸起多邊形的上邊、繪製凸起多邊形右下角的圓弧、繪製凸起多邊形的右邊、繪製矩形的上邊、繪製矩形右上角的圓弧、繪製矩形的右邊、繪製矩形右下角圓弧、繪製矩形的下邊、繪製矩形左下角的圓弧、繪製矩形的左邊、回到起點。   第三步,透過畫布Canvas畫邊框以及畫顏色。第四步,繪製視圖組件四周陰影。   圖2(a)為本案實施例提供的一種視圖組件的繪製路徑的示意圖。   從圖2(a)中可以看到透過上述方式繪製得到的視圖組件。   其次,調用類目間隔Item Decoration,將所述第一視圖組件與所述第二視圖組件之間的間隔設置為負值。   具體地,若所述第一視圖組件的邊框的樣式和所述第二視圖組件的邊框的樣式為上邊框的左上角/右上角凸起的矩形,那麼將所述第一視圖組件與所述第二視圖組件之間的間隔的大小值設置為凸起的高度。   在本案實施例中利用RecyclerView分割線的可擴展性以及能自定義的特性。透過繼承ItemDecoration抽象方法,並重載其getItemOffset()方法,將不同視圖組件(相鄰分布的視圖組件之間)之間的分割線的數值設置為負值,即將平舖邏輯對應的相鄰分布的兩個視圖組件之間的間隔設置為負值,從而使相鄰分布的兩個視圖組件形成疊加效果。   進而,利用適配器設置多個這樣的視圖組件,那麼適配器對應的佈局容器中的多個視圖組件可以形成疊加的層疊式佈局。   下面以作業系統為iOS作業系統為例說明如何繪製得到第一視圖組件的。   首先,繪製第一視圖組件的邊框,所述邊框為矩形。   其次,在所述第一視圖組件上按照設定路徑創建CAShapeLayer,所述CAShapeLayer為所述第一視圖組件的蒙層。   其中,所述設定路徑為:   A(0,R)—〉B(W2,R)—〉C(W1,R)—〉D(W1,H+R)—〉E(W2,H+R)—〉F(0,H+R)—〉A(0,R)的閉合曲線;   其中,以所述第一視圖組件的邊框的左上角頂點為座標系的原點,AB與所述第一視圖組件的上邊框形成凸起曲線,BC、CD和DE為線段,EF與所述第一視圖組件的下邊框形成凸起曲線,R為凸起曲線的半徑,W1為所述第一視圖組件的邊框的寬度,W2為凸起曲線的寬度,H為所述第一視圖組件的邊框的高度。   圖2(b)為本案實施例提供的一種視圖組件的繪製路徑的示意圖。   從圖2(b)中可以看到透過上述方式繪製得到的視圖組件。   步驟202:加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。   在本案實施例中,若第一視圖組件與第二視圖組件採用圖2(a)所示的繪製路徑得到,那麼在加載顯示所述第一視圖組件和所述第二視圖組件後,所述第一視圖組件與所述第二視圖組件呈層疊式佈局,如圖3所示,為本案實施例提供的一種層疊式佈局的示意圖。   從圖3中可以看出,第一視圖組件與第二視圖組件呈疊加效果。   針對圖3中所示的各視圖組件,可以對這些視圖組件執行操作,實現視圖組件的展開與收縮。   較佳地,所述方法還包括:   接收用戶發送的觸控指令,所述觸控指令用於變更被觸控的視圖組件的顯示狀態;   在確定所述被觸控的視圖組件的顯示狀態為收縮狀態時,將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態;   在確定所述被觸控的視圖組件的顯示狀態為展開狀態時,將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態。   這裡以單個視圖組件的顯示狀態發生變化為例進行說明。   在將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態時,調用ValueAnimatorSet,基於所述被觸控的視圖組件的顯示位置和設置的高度屬性值,將所述被觸控的視圖組件展開設定高度屬性值對應的高度,視為將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態。   圖3(a)為本案實施例圖3所示的層疊式佈局中視圖組件的展開狀態示意圖。   較佳地,在將所述被觸控的視圖組件展開設定高度後,所述方法還包括:   若ValueAnimatorSet中還包含紋理屬性值,那麼根據所述紋理屬性值,在展開的所述被觸控的視圖組件中動態顯示所述紋理屬性值對應的紋理狀態。   在此,如果再次接收到用戶發送的觸控指令,由於此時所述被觸控的視圖組件的顯示狀態為展開狀態,那麼將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態,如圖3(b)所示,為本案實施例圖3所示的層疊式佈局中視圖組件的收縮狀態示意圖。   在本案實施例中,在將所述被觸控的視圖組件展開設定高度前,所述方法還包括:   確定所述佈局容器中是否存在其他視圖組件處於展開狀態;   若存在,則將所述其他視圖組件的顯示狀態由展開狀態調整為收縮狀態。   也就是,可以在不同的視圖組件之間實現展開與收縮的切換操作。   例如:當當前觸控指令所對應的第一視圖組件處於上一次觸控操作的第二視圖組件的上方時,第一視圖組件的高度增加,同時第二視圖組件的顯示高度減小,模擬形成向下伸展的動畫,此時第一視圖組件的顯示狀態由收縮狀態調整為展開狀態,而第二視圖組件的顯示狀態由展開狀態調整為收縮狀態。   再例如:當當前觸控指令所對應的第一視圖組件處於上一次觸控操作的第二視圖組件的下方時,第一視圖組件的高度增加,同時第二視圖組件的顯示高度減小,模擬形成向上伸展的動畫,此時第一視圖組件的顯示狀態由收縮狀態調整為展開狀態,而第二視圖組件的顯示狀態由展開狀態調整為收縮狀態。   在本案實施例中,若第一視圖組件與第二視圖組件採用圖2(b)所示的繪製路徑得到,那麼在加載顯示所述第一視圖組件和所述第二視圖組件後,所述第一視圖組件與所述第二視圖組件呈層疊式佈局,如圖4所示,為本案實施例提供的一種層疊式佈局的示意圖。   從圖4中可以看出,第一視圖組件與第二視圖組件呈疊加效果。   針對圖4中所示的各視圖組件,可以對這些視圖組件執行操作,實現視圖組件的展開與收縮。   較佳地,所述方法還包括:   接收用戶發送的觸控指令,所述觸控指令用於變更被觸控的視圖組件的顯示狀態;   在確定所述被觸控的視圖組件的顯示狀態為收縮狀態時,將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態;   在確定所述被觸控的視圖組件的顯示狀態為展開狀態時,將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態。   這裡以單個視圖組件的顯示狀態發生變化為例進行說明。   在將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態時,調用TableView,增加所述被觸控的視圖組件的第一顯示高度;   根據增加的第一顯示高度,調整該被觸控的視圖組件上的蒙層的第二顯示高度,所述第二顯示高度與所述第一顯示高度相同。   圖4(a)為本案實施例圖4所示的層疊式佈局中視圖組件的展開狀態示意圖。   較佳地,所述方法還包括:   根據佈局邏輯和所述第一顯示高度,將位於所述被觸控的視圖組件之後的其他視圖組件的位置向下移動所述第一顯示高度。   較佳地,所述方法還包括:   為了防止灰色背景的大小與tableview中視圖組件的顯示內容大小一致,可以啓動監聽事件,該監聽事件用於計算視圖組件的顯示內容大小的變化,並根據顯示內容大小的變化,調整灰色背景的大小,使得灰色背景與視圖組件的顯示內容大小一致。   在此,如果再次接收到用戶發送的觸控指令,由於此時所述被觸控的視圖組件的顯示狀態為展開狀態,那麼將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態,如圖4(b)所示,為本案實施例圖4所示的層疊式佈局中視圖組件的收縮狀態示意圖。   較佳地,在將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態後,所述方法還包括:   在確定有空白區域出現時,根據所述佈局容器中的佈局邏輯,在所述空白區域中加載顯示其他視圖組件。   透過本案實施例提供的技術方案,透過確定佈局容器中包含的第一視圖組件和第二視圖組件;加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。也就是說,透過本案實施例提供的技術方案能夠有效實現佈局容器中的不同視圖組件之間呈層疊式佈局,有效提高了用戶的視覺效果,與平舖佈局相比,增加了不同視圖組件之間的緊湊性,在展示商品對象的某種屬性時,使得用戶能夠快速確定其區別,提升用戶對商品對象的用戶體驗。   圖5為本案實施例提供的一種視圖組件的佈局方法的流程示意圖。所述方法可以如下所示。   步驟501:確定佈局容器中包含的第一視圖組件和第二視圖組件,所述第一視圖組件與所述第二視圖組件之間的間隔為負值。   步驟502:加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。   步驟503:接收用戶發送的觸控指令,所述觸控指令用於變更被觸控的視圖組件的顯示狀態。   步驟504:在確定所述被觸控的視圖組件的顯示狀態為收縮狀態時,調用ValueAnimatorSet,基於所述被觸控的視圖組件的顯示位置和設置的高度屬性值,將所述被觸控的視圖組件展開設定高度屬性值對應的高度,視為將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態。   較佳地,在將所述被觸控的視圖組件展開設定高度前,所述方法還包括:   確定所述佈局容器中是否存在其他視圖組件處於展開狀態;   若存在,則將所述其他視圖組件的顯示狀態由展開狀態調整為收縮狀態。   較佳地,在將所述被觸控的視圖組件展開設定高度後,所述方法還包括:   若ValueAnimatorSet中還包含紋理屬性值,那麼根據所述紋理屬性值,在展開的所述被觸控的視圖組件中動態顯示所述紋理屬性值對應的紋理狀態。   步驟505:在確定所述被觸控的視圖組件的顯示狀態為展開狀態時,將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態。   圖6為本案實施例提供的一種視圖組件的佈局方法的流程示意圖。所述方法可以如下所示。   步驟601:確定佈局容器中包含的第一視圖組件和第二視圖組件,所述第一視圖組件和所述第二視圖組件上按照設定路徑創建蒙層。   步驟602:加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。   較佳地,所述設定路徑為:   A(0,R)—〉B(W2,R)—〉C(W1,R)—〉D(W1,H+R)—〉E(W2,H+R)—〉F(0,H+R)—〉A(0,R)的閉合曲線;   其中,以所述第一視圖組件的邊框的左上角頂點為座標系的原點,AB與所述第一視圖組件的上邊框形成凸起曲線,BC、CD和DE為線段,EF與所述第一視圖組件的下邊框形成凸起曲線,R為凸起曲線的半徑,W1為所述第一視圖組件的邊框的寬度,W2為凸起曲線的寬度,H為所述第一視圖組件的邊框的高度。   步驟603:接收用戶發送的觸控指令,所述觸控指令用於變更被觸控的視圖組件的顯示狀態。   步驟604:在確定所述被觸控的視圖組件的顯示狀態為收縮狀態時,調用TableView,增加所述被觸控的視圖組件的第一顯示高度。   步驟605:根據增加的第一顯示高度,調整所述蒙層的第二顯示高度,所述第二顯示高度與所述第一顯示高度相同。   步驟606:根據佈局邏輯和所述第一顯示高度,將位於所述被觸控的視圖組件之後的其他視圖組件的位置向下移動所述第一顯示高度。   較佳地,在將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態後,所述方法還包括:   在確定有空白區域出現時,根據所述佈局容器中的佈局邏輯,在所述空白區域中加載顯示其他視圖組件。   步驟607:在確定所述被觸控的視圖組件的顯示狀態為展開狀態時,將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態。   圖7為本案實施例提供的一種視圖組件的佈局設備的結構示意圖。所述佈局設備包括:確定單元701和處理單元702,其中:   確定單元701,確定佈局容器中包含的第一視圖組件和第二視圖組件;   處理單元702,加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。   在本案的另一個實施例中,所述佈局設備還包括:繪製單元703,其中:   所述繪製單元703,在確定佈局容器中包含的第一視圖組件和第二視圖組件之前,繪製第一視圖組件和第二視圖組件。   在本案的另一個實施例中,所述繪製單元703繪製第一視圖組件和第二視圖組件,包括:   繪製第一視圖組件的邊框和第二視圖組件的邊框;   調用類目間隔Item Decoration,將所述第一視圖組件與所述第二視圖組件之間的間隔設置為負值。   在本案的另一個實施例中,所述繪製單元703,若所述第一視圖組件的邊框的樣式和所述第二視圖組件的邊框的樣式為上邊框的左上角/右上角凸起的矩形,那麼將所述第一視圖組件與所述第二視圖組件之間的間隔的大小值設置為凸起的高度。   在本案的另一個實施例中,所述繪製單元703繪製第一視圖組件,包括:   繪製第一視圖組件的邊框,所述邊框為矩形;   在所述第一視圖組件上按照設定路徑創建 CAShapeLayer,所述CAShapeLayer為所述第一視圖組件的蒙層。   在本案的另一個實施例中,所述設定路徑為:   A(0,R)—〉B(W2,R)—〉C(W1,R)—〉D(W1,H+R)—〉E(W2,H+R)—〉F(0,H+R)—〉A(0,R)的閉合曲線;   其中,以所述第一視圖組件的邊框的左上角頂點為座標系的原點,AB與所述第一視圖組件的上邊框形成凸起曲線,BC、CD和DE為線段,EF與所述第一視圖組件的下邊框形成凸起曲線,R為凸起曲線的半徑,W1為所述第一視圖組件的邊框的寬度,W2為凸起曲線的寬度,H為所述第一視圖組件的邊框的高度。   在本案的另一個實施例中,所述佈局設備還包括:接收單元704和調整單元705,其中:   所述接收單元704,接收用戶發送的觸控指令,所述觸控指令用於變更被觸控的視圖組件的顯示狀態;   所述調整單元705,在確定所述被觸控的視圖組件的顯示狀態為收縮狀態時,將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態;   在確定所述被觸控的視圖組件的顯示狀態為展開狀態時,將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態。   在本案的另一個實施例中,所述調整單元705將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態,包括:   調用ValueAnimatorSet,基於所述被觸控的視圖組件的顯示位置和設置的高度屬性值,將所述被觸控的視圖組件展開設定高度屬性值對應的高度,視為將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態。   在本案的另一個實施例中,所述調整單元705在將所述被觸控的視圖組件展開設定高度前,確定所述佈局容器中是否存在其他視圖組件處於展開狀態;   若存在,則將所述其他視圖組件的顯示狀態由展開狀態調整為收縮狀態。   在本案的另一個實施例中,所述調整單元705在將所述被觸控的視圖組件展開設定高度後,若 ValueAnimatorSet中還包含紋理屬性值,那麼根據所述紋理屬性值,在展開的所述被觸控的視圖組件中動態顯示所述紋理屬性值對應的紋理狀態。   在本案的另一個實施例中,所述調整單元705將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態,包括:   若所述被觸控的視圖組件中包含蒙層,那麼調用TableView,增加所述被觸控的視圖組件的第一顯示高度;   根據增加的第一顯示高度,調整所述蒙層的第二顯示高度,所述第二顯示高度與所述第一顯示高度相同。   在本案的另一個實施例中,所述調整單元705,根據佈局邏輯和所述第一顯示高度,將位於所述被觸控的視圖組件之後的其他視圖組件的位置向下移動所述第一顯示高度。   在本案的另一個實施例中,所述佈局設備還包括:加載單元706,其中:   所述加載單元706,在將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態後,在確定有空白區域出現時,根據所述佈局容器中的佈局邏輯,在所述空白區域中加載顯示其他視圖組件。   需要說明的是,本案實施例提供的佈局設備可以透過軟體方式實現,也可以透過硬體方式實現,這裡不做具體限定。佈局設備透過確定佈局容器中包含的第一視圖組件和第二視圖組件;加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。也就是說,透過本案實施例提供的技術方案能夠有效實現佈局容器中的不同視圖組件之間呈層疊式佈局,有效提高了用戶的視覺效果,與平舖佈局相比,增加了不同視圖組件之間的緊湊性,在展示商品對象的某種屬性時,使得用戶能夠快速確定其區別,提升用戶對商品對象的用戶體驗。   圖8為本案實施例提供的一種視圖組件的佈局設備的結構示意圖。所述佈局設備包括:確定單元801和處理單元802,其中:   確定單元801,確定佈局容器中包含的第一視圖組件和第二視圖組件,所述第一視圖組件與所述第二視圖組件之間的間隔為負值;   處理單元802,加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。   在本案的另一個實施例中,所述佈局設備還包括:接收單元803和調整單元804,其中:   所述接收單元803,接收用戶發送的觸控指令,所述觸控指令用於變更被觸控的視圖組件的顯示狀態;   所述調整單元804,在確定所述被觸控的視圖組件的顯示狀態為收縮狀態時,將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態;   在確定所述被觸控的視圖組件的顯示狀態為展開狀態時,將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態。   在本案的另一個實施例中,所述調整單元804將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態,包括:   調用ValueAnimatorSet,基於所述被觸控的視圖組件的顯示位置和設置的高度屬性值,將所述被觸控的視圖組件展開設定高度屬性值對應的高度,視為將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態。   在本案的另一個實施例中,所述調整單元804,在將所述被觸控的視圖組件展開設定高度前,確定所述佈局容器中是否存在其他視圖組件處於展開狀態;   若存在,則將所述其他視圖組件的顯示狀態由展開狀態調整為收縮狀態。   在本案的另一個實施例中,所述調整單元804,在將所述被觸控的視圖組件展開設定高度後,若 ValueAnimatorSet中還包含紋理屬性值,那麼根據所述紋理屬性值,在展開的所述被觸控的視圖組件中動態顯示所述紋理屬性值對應的紋理狀態。   需要說明的是,本案實施例提供的佈局設備可以透過軟體方式實現,也可以透過硬體方式實現,這裡不做具體限定。佈局設備透過本案實施例提供的技術方案能夠有效實現佈局容器中的不同視圖組件之間呈層疊式佈局,有效提高了用戶的視覺效果,與平舖佈局相比,增加了不同視圖組件之間的緊湊性,在展示商品對象的某種屬性時,使得用戶能夠快速確定其區別,提升用戶對商品對象的用戶體驗。   圖9為本案實施例提供的一種視圖組件的佈局設備的結構示意圖。所述佈局設備包括:確定單元901和處理單元902,其中:   確定單元901,確定佈局容器中包含的第一視圖組件和第二視圖組件,所述第一視圖組件和所述第二視圖組件上按照設定路徑創建蒙層;   處理單元902,加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。   在本案的另一個實施例中,所述設定路徑為:   A(0,R)—〉B(W2,R)—〉C(W1,R)—〉D(W1,H+R)—〉E(W2,H+R)—〉F(0,H+R)—〉A(0,R)的閉合曲線;   其中,以所述第一視圖組件的邊框的左上角頂點為座標系的原點,AB與所述第一視圖組件的上邊框形成凸起曲線,BC、CD和DE為線段,EF與所述第一視圖組件的下邊框形成凸起曲線,R為凸起曲線的半徑,W1為所述第一視圖組件的邊框的寬度,W2為凸起曲線的寬度,H為所述第一視圖組件的邊框的高度。   在本案的另一個實施例中,所述佈局設備還包括:接收單元903和調整單元904,其中:   所述接收單元903,接收用戶發送的觸控指令,所述觸控指令用於變更被觸控的視圖組件的顯示狀態;   所述調整單元904,在確定所述被觸控的視圖組件的顯示狀態為收縮狀態時,將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態;   在確定所述被觸控的視圖組件的顯示狀態為展開狀態時,將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態。   在本案的另一個實施例中,所述調整單元904將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態,包括:   若所述被觸控的視圖組件中包含蒙層,那麼調用TableView,增加所述被觸控的視圖組件的第一顯示高度;   根據增加的第一顯示高度,調整所述蒙層的第二顯示高度,所述第二顯示高度與所述第一顯示高度相同。   在本案的另一個實施例中,所述調整單元904,根據佈局邏輯和所述第一顯示高度,將位於所述被觸控的視圖組件之後的其他視圖組件的位置向下移動所述第一顯示高度。   在本案的另一個實施例中,所述佈局設備還包括:加載單元905,其中:   所述加載單元905,在將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態後,在確定有空白區域出現時,根據所述佈局容器中的佈局邏輯,在所述空白區域中加載顯示其他視圖組件。   需要說明的是,本案實施例提供的佈局設備可以透過軟體方式實現,也可以透過硬體方式實現,這裡不做具體限定。佈局設備透過本案實施例提供的技術方案能夠有效實現佈局容器中的不同視圖組件之間呈層疊式佈局,有效提高了用戶的視覺效果,與平舖佈局相比,增加了不同視圖組件之間的緊湊性,在展示商品對象的某種屬性時,使得用戶能夠快速確定其區別,提升用戶對商品對象的用戶體驗。   本領域內的技術人員應明白,本發明的實施例可提供為方法、系統、或計算機程式產品。因此,本發明可採用完全硬體實施例、完全軟體實施例、或結合軟體和硬體方面的實施例的形式。而且,本發明可採用在一個或多個其中包含有計算機可用程式代碼的計算機可用儲存媒體(包括但不限於磁碟記憶體、CD-ROM、光學記憶體等)上實施的計算機程式產品的形式。   本發明是參照根據本發明實施例的方法、設備(系統)、和計算機程式產品的流程圖和/或方塊圖來描述的。應理解可由計算機程式指令實現流程圖和/或方塊圖中的每一流程和/或方塊、以及流程圖和/或方塊圖中的流程和/或方塊的結合。可提供這些計算機程式指令到通用計算機、專用計算機、嵌入式處理機或其他可程式資料處理設備的處理器以產生一個機器,使得透過計算機或其他可程式資料處理設備的處理器執行的指令產生用於實現在流程圖一個流程或多個流程和/或方塊圖一個方塊或多個方塊中指定的功能的裝置。   這些計算機程式指令也可儲存在能引導計算機或其他可程式資料處理設備以特定方式工作的計算機可讀記憶體中,使得儲存在該計算機可讀記憶體中的指令產生包括指令裝置的製造品,該指令裝置實現在流程圖一個流程或多個流程和/或方塊圖一個方塊或多個方塊中指定的功能。   這些計算機程式指令也可裝載到計算機或其他可程式資料處理設備上,使得在計算機或其他可程式設備上執行一系列操作步驟以產生計算機實現的處理,從而在計算機或其他可程式設備上執行的指令提供用於實現在流程圖一個流程或多個流程和/或方塊圖一個方塊或多個方塊中指定的功能的步驟。   在一個典型的配置中,計算設備包括一個或多個處理器 (CPU)、輸入/輸出介面、網路介面和記憶體。   記憶體可能包括計算機可讀媒體中的非永久性記憶體,隨機存取記憶體(RAM)和/或非易失性記憶體等形式,如唯讀記憶體(ROM)或快閃記憶體(flash RAM)。記憶體是計算機可讀媒體的示例。   計算機可讀媒體包括永久性和非永久性、可移動和非可移動媒體可以由任何方法或技術來實現信息儲存。信息可以是計算機可讀指令、資料結構、程式的模組或其他資料。計算機的儲存媒體的例子包括,但不限於相變記憶體(PRAM)、靜態隨機存取記憶體(SRAM)、動態隨機存取記憶體(DRAM)、其他類型的隨機存取記憶體(RAM)、唯讀記憶體(ROM)、電可抹除可程式唯讀記憶體(EEPROM)、快閃記憶體或其他記憶體技術、唯讀光碟唯讀記憶體(CD-ROM)、數位多功能光碟(DVD)或其他光學儲存、磁盒式磁帶,磁帶磁碟儲存或其他磁性儲存設備或任何其他非傳輸媒體,可用於儲存可以被計算設備訪問的信息。按照本文中的界定,計算機可讀媒體不包括暫存電腦可讀媒體(transitory media),如調變的資料信號和載波。   還需要說明的是,術語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要素的過程、方法、商品或者設備不僅包括那些要素,而且還包括沒有明確列出的其他要素,或者是還包括為這種過程、方法、商品或者設備所固有的要素。在沒有更多限制的情况下,由語句“包括一個……”限定的要素,並不排除在包括所述要素的過程、方法、商品或者設備中還存在另外的相同要素。   本領域技術人員應明白,本案的實施例可提供為方法、系統或計算機程式產品。因此,本案可採用完全硬體實施例、完全軟體實施例或結合軟體和硬體方面的實施例的形式。而且,本案可採用在一個或多個其中包含有計算機可用程式代碼的計算機可用儲存媒體(包括但不限於磁碟記憶體、CD-ROM、光學記憶體等)上實施的計算機程式產品的形式。   以上所述僅為本案的實施例而已,並不用於限制本案。對於本領域技術人員來說,本案可以有各種更改和變化。凡在本案的精神和原理之內所作的任何修改、等同替換、改進等,均應包含在本案的申請專利範圍之內。In order to achieve the purpose of the case, The embodiment of the present invention provides a layout method and device for a view component, By determining the first view component and the second view component included in the layout container; Loading displays the first view component and the second view component, The first view component and the second view component are in a stacked layout. That is, The technical solution provided by the embodiment of the present invention can effectively realize the cascading layout between different view components in the layout container. Effectively improve the user's visual effects, Compared to the tile layout, Increased compactness between different view components, When displaying a property of a product object, Allowing users to quickly determine the difference, Improve user experience with product objects.   It should be noted, The layout container described in the embodiment of the present invention can be understood as a collection of view components. Multiple view components are included in the layout container. And the layout container contains the layout logic for these view components, The layout logic here contains the order in which the view components are arranged (for example: Linear alignment, etc.), Relative positional relationship between different view components, and many more. The layout of the view components contained in the layout container can be achieved through the layout controller.  For the purposes of this case, Technical solutions and advantages are more clear, In the following, the technical solution of the present case will be clearly understood in combination with the specific embodiment of the present invention and the corresponding drawings. Completely described. Obviously, The described embodiment is only a part of the embodiment of the present invention. Rather than all embodiments. Based on the embodiment in the present case, All other embodiments obtained by those of ordinary skill in the art without creative efforts, Both belong to the scope of protection of this case.  The following is combined with the drawings. The technical solutions provided by the embodiments of the present invention are described in detail.  FIG. 2 is a schematic flow chart of a method for laying out a view component according to an embodiment of the present disclosure. The method can be as follows.  Step 201: Determine the first view component and the second view component contained in the layout container.  In the embodiment of the present invention, Before determining the first view component and the second view component included in the layout container, The method further includes:  Draw the first view component and the second view component.  Due to different operating systems, Then the way to draw the view component is different. Here, the operating system is described as an example of the Android operating system and the iOS operating system.  The following uses the operating system as an Android operating system as an example to illustrate how to draw the first view component and the second view component.   First of all, Draws the border of the first view component and the border of the second view component.  In the embodiment of the present invention, the borders of the first view component and the second view component may be regular shapes. It can also be an irregular shape. There is no specific limit here.  Take the irregular shape as an example to draw the border of the view component. first step, Initialize the width value of the view component, Height value, The radius value of the rounded corners, Set the border brush Paint, Color brush Paint (here contains settings for anti-aliasing, Hollow and other parameters).  The second step, Create a border drawing path Path, The color draw path Path.  The starting point of the drawing path is the arc of the upper left corner of the drawing rectangle. The drawing order is: Draw the arc in the upper left corner of the rectangle, Draw the top edge of the raised polygon, Draw the arc in the lower right corner of the raised polygon, Draw the right side of the raised polygon, Draw the top edge of the rectangle, Draw the arc in the upper right corner of the rectangle, Draw the right side of the rectangle, Draw the arc in the lower right corner of the rectangle, Draw the bottom of the rectangle, Draw the arc in the lower left corner of the rectangle, Draw the left side of the rectangle, Go back to the beginning.   third step, Draw borders and draw colors through canvas Canvas. the fourth step, Draw a shadow around the view component.  FIG. 2( a ) is a schematic diagram of a drawing path of a view component provided by an embodiment of the present invention.  The view component drawn in the above manner can be seen from Fig. 2(a).  Secondly, Call the category interval Item Decoration, The interval between the first view component and the second view component is set to a negative value.   specifically, If the style of the border of the first view component and the style of the border of the second view component are raised rectangles of the upper left corner/upper right corner of the upper border, The size value of the spacing between the first view component and the second view component is then set to the height of the bump.  In the embodiment of the present invention, the scalability and the customizable characteristics of the RecyclerView split line are utilized. By inheriting the ItemDecoration abstraction method, And override its getItemOffset() method, Set the value of the split line between different view components (between adjacently distributed view components) to a negative value, The interval between two view components of the adjacent distribution corresponding to the tile logic is set to a negative value, Thereby the two view components of the adjacent distribution form an overlay effect.   and then, Use the adapter to set up multiple such view components, Then multiple view components in the layout container corresponding to the adapter can form a stacked cascading layout.  Let's take the operating system as an example of the iOS operating system to illustrate how to draw the first view component.   First of all, Draw the border of the first view component, The frame is a rectangle.  Secondly, Creating a CAShapeLayer according to the set path on the first view component, The CAShapeLayer is a layer of the first view component.   among them, The set path is:  A (0, R) -> B (W2, R) -> C (W1, R) -> D (W1, H+R)—>E(W2, H+R)—>F(0, H+R)—>A(0, a closed curve of R);   among them, Taking the top left vertex of the border of the first view component as the origin of the coordinate system, AB forms a convex curve with the upper frame of the first view component, BC, CD and DE are line segments, The EF forms a convex curve with the lower frame of the first view component. R is the radius of the convex curve, W1 is the width of the border of the first view component, W2 is the width of the convex curve, H is the height of the border of the first view component.  FIG. 2(b) is a schematic diagram of a drawing path of a view component provided by an embodiment of the present invention.  The view component drawn in the above manner can be seen from Fig. 2(b).  Step 202: Loading displays the first view component and the second view component, The first view component and the second view component are in a stacked layout.  In the embodiment of the present invention, If the first view component and the second view component are obtained by using the drawing path shown in FIG. 2(a), Then after loading and displaying the first view component and the second view component, The first view component and the second view component are in a stacked layout. As shown in Figure 3, A schematic diagram of a stacked layout provided by an embodiment of the present invention.  As can be seen from Figure 3, The first view component and the second view component are superimposed.  For each view component shown in Figure 3, You can perform operations on these view components. Implement the expansion and contraction of view components.  Preferably, The method further includes:  Receiving touch commands sent by the user, The touch instruction is used to change a display state of the touched view component;  When it is determined that the display state of the touched view component is a contracted state, Adjusting a display state of the touched view component from a contracted state to an expanded state;  When it is determined that the display state of the touched view component is an expanded state, Adjusting the display state of the touched view component from an expanded state to a contracted state.  Here, the display state of a single view component changes as an example.  When the display state of the touched view component is adjusted from the contracted state to the expanded state, Call ValueAnimatorSet, Based on the display position of the touched view component and the set height attribute value, Expanding the touched view component to a height corresponding to a set height attribute value, It is considered that the display state of the touched view component is adjusted from a contracted state to an expanded state.  Fig. 3 (a) is a schematic view showing the unfolded state of the view assembly in the stacked layout shown in Fig. 3 of the embodiment of the present invention.  Preferably, After the touched view component is expanded to a set height, The method further includes:  If the ValueAnimatorSet also contains texture property values, Then according to the texture attribute value, Dynamically displaying the texture state corresponding to the texture attribute value in the expanded touched view component.   here, If the touch command sent by the user is received again, Since the display state of the touched view component is an expanded state at this time, Then, the display state of the touched view component is adjusted from the expanded state to the contracted state. As shown in Figure 3(b), A schematic diagram of the collapsed state of the view assembly in the stacked layout shown in FIG. 3 of the embodiment of the present invention.  In the embodiment of the present invention, Before expanding the touched view component to a set height, The method further includes:  Determining whether there are other view components in the layout container in an expanded state;  If it exists, Then, the display state of the other view components is adjusted from the expanded state to the contracted state.  That is, Switching between expansion and contraction can be implemented between different view components.   E.g: When the first view component corresponding to the current touch command is above the second view component of the last touch operation, The height of the first view component is increased, At the same time, the display height of the second view component is reduced, Simulate an animation that forms a downward stretch, At this time, the display state of the first view component is adjusted from the contracted state to the expanded state. The display state of the second view component is adjusted from the expanded state to the contracted state.  Another example: When the first view component corresponding to the current touch command is below the second view component of the last touch operation, The height of the first view component is increased, At the same time, the display height of the second view component is reduced, The simulation forms an upward stretched animation, At this time, the display state of the first view component is adjusted from the contracted state to the expanded state. The display state of the second view component is adjusted from the expanded state to the contracted state.  In the embodiment of the present invention, If the first view component and the second view component are obtained by using the drawing path shown in FIG. 2(b), Then after loading and displaying the first view component and the second view component, The first view component and the second view component are in a stacked layout. As shown in Figure 4, A schematic diagram of a stacked layout provided by an embodiment of the present invention.  As can be seen from Figure 4, The first view component and the second view component are superimposed.  For each view component shown in Figure 4, You can perform operations on these view components. Implement the expansion and contraction of view components.  Preferably, The method further includes:  Receiving touch commands sent by the user, The touch instruction is used to change a display state of the touched view component;  When it is determined that the display state of the touched view component is a contracted state, Adjusting a display state of the touched view component from a contracted state to an expanded state;  When it is determined that the display state of the touched view component is an expanded state, Adjusting the display state of the touched view component from an expanded state to a contracted state.  Here, the display state of a single view component changes as an example.  When the display state of the touched view component is adjusted from the contracted state to the expanded state, Call TableView, Increasing a first display height of the touched view component;  According to the increased first display height, Adjusting the second display height of the mask on the touched view component, The second display height is the same as the first display height.  4(a) is a schematic view showing the unfolded state of the view assembly in the stacked layout shown in FIG. 4 of the embodiment of the present invention.  Preferably, The method further includes:  According to the layout logic and the first display height, Moving the position of the other view components located behind the touched view component down the first display height.  Preferably, The method further includes:  In order to prevent the size of the gray background from being consistent with the size of the display component of the view component in the tableview, Can start a listen event, The listen event is used to calculate the change in the display content size of the view component. And according to the change in the size of the display content, Adjust the size of the gray background, Make the gray background consistent with the display content size of the view component.   here, If the touch command sent by the user is received again, Since the display state of the touched view component is an expanded state at this time, Then, the display state of the touched view component is adjusted from the expanded state to the contracted state. As shown in Figure 4(b), A schematic diagram of the collapsed state of the view assembly in the stacked layout shown in FIG. 4 of the embodiment of the present invention.  Preferably, After adjusting the display state of the touched view component from the expanded state to the contracted state, The method further includes:  When it is determined that a blank area appears, According to the layout logic in the layout container, Loading and displaying other view components in the blank area.  Through the technical solutions provided by the embodiments of the present invention, By determining the first view component and the second view component included in the layout container; Loading displays the first view component and the second view component, The first view component and the second view component are in a stacked layout. That is, The technical solution provided by the embodiment of the present invention can effectively realize the cascading layout between different view components in the layout container. Effectively improve the user's visual effects, Compared to the tile layout, Increased compactness between different view components, When displaying a property of a product object, Allowing users to quickly determine the difference, Improve user experience with product objects.  FIG. 5 is a schematic flow chart of a method for laying out a view component according to an embodiment of the present disclosure. The method can be as follows.  Step 501: Determining the first view component and the second view component contained in the layout container, The interval between the first view component and the second view component is a negative value.  Step 502: Loading displays the first view component and the second view component, The first view component and the second view component are in a stacked layout.  Step 503: Receiving touch commands sent by the user, The touch command is used to change the display state of the touched view component.  Step 504: When it is determined that the display state of the touched view component is a contracted state, Call ValueAnimatorSet, Based on the display position of the touched view component and the set height attribute value, Expanding the touched view component to a height corresponding to a set height attribute value, It is considered that the display state of the touched view component is adjusted from a contracted state to an expanded state.  Preferably, Before expanding the touched view component to a set height, The method further includes:  Determining whether there are other view components in the layout container in an expanded state;  If it exists, Then, the display state of the other view components is adjusted from the expanded state to the contracted state.  Preferably, After the touched view component is expanded to a set height, The method further includes:  If the ValueAnimatorSet also contains texture property values, Then according to the texture attribute value, Dynamically displaying the texture state corresponding to the texture attribute value in the expanded touched view component.  Step 505: When it is determined that the display state of the touched view component is an expanded state, Adjusting the display state of the touched view component from an expanded state to a contracted state.  FIG. 6 is a schematic flowchart diagram of a layout method of a view component according to an embodiment of the present disclosure. The method can be as follows.  Step 601: Determining the first view component and the second view component contained in the layout container, A mask is created on the first view component and the second view component according to a set path.  Step 602: Loading displays the first view component and the second view component, The first view component and the second view component are in a stacked layout.  Preferably, The set path is:  A (0, R) -> B (W2, R) -> C (W1, R) -> D (W1, H+R)—>E(W2, H+R)—>F(0, H+R)—>A(0, a closed curve of R);   among them, Taking the top left vertex of the border of the first view component as the origin of the coordinate system, AB forms a convex curve with the upper frame of the first view component, BC, CD and DE are line segments, The EF forms a convex curve with the lower frame of the first view component. R is the radius of the convex curve, W1 is the width of the border of the first view component, W2 is the width of the convex curve, H is the height of the border of the first view component.  Step 603: Receiving touch commands sent by the user, The touch command is used to change the display state of the touched view component.  Step 604: When it is determined that the display state of the touched view component is a contracted state, Call TableView, Increasing a first display height of the touched view component.  Step 605: According to the increased first display height, Adjusting the second display height of the mask layer, The second display height is the same as the first display height.  Step 606: According to the layout logic and the first display height, Moving the position of the other view components located behind the touched view component down the first display height.  Preferably, After adjusting the display state of the touched view component from the expanded state to the contracted state, The method further includes:  When it is determined that a blank area appears, According to the layout logic in the layout container, Loading and displaying other view components in the blank area.  Step 607: When it is determined that the display state of the touched view component is an expanded state, Adjusting the display state of the touched view component from an expanded state to a contracted state.  FIG. 7 is a schematic structural diagram of a layout device of a view component according to an embodiment of the present disclosure. The layout device includes: Determining unit 701 and processing unit 702, among them:  Determining unit 701, Determining a first view component and a second view component included in the layout container;  Processing unit 702, Loading displays the first view component and the second view component, The first view component and the second view component are in a stacked layout.  In another embodiment of the present disclosure, The layout device further includes: Drawing unit 703, among them:  The drawing unit 703, Before determining the first view component and the second view component included in the layout container, Draw the first view component and the second view component.  In another embodiment of the present disclosure, The drawing unit 703 draws a first view component and a second view component, include:  Drawing a border of the first view component and a border of the second view component;  Call the category interval Item Decoration, The interval between the first view component and the second view component is set to a negative value.  In another embodiment of the present disclosure, The drawing unit 703, If the style of the border of the first view component and the style of the border of the second view component are raised rectangles of the upper left corner/upper right corner of the upper border, The size value of the spacing between the first view component and the second view component is then set to the height of the bump.  In another embodiment of the present disclosure, The drawing unit 703 draws a first view component, include:  Draw the border of the first view component, The frame is rectangular;  Create a CAShapeLayer on the first view component according to the set path, The CAShapeLayer is a layer of the first view component.  In another embodiment of the present disclosure, The set path is:  A (0, R) -> B (W2, R) -> C (W1, R) -> D (W1, H+R)—>E(W2, H+R)—>F(0, H+R)—>A(0, a closed curve of R);   among them, Taking the top left vertex of the border of the first view component as the origin of the coordinate system, AB forms a convex curve with the upper frame of the first view component, BC, CD and DE are line segments, The EF forms a convex curve with the lower frame of the first view component. R is the radius of the convex curve, W1 is the width of the border of the first view component, W2 is the width of the convex curve, H is the height of the border of the first view component.  In another embodiment of the present disclosure, The layout device further includes: Receiving unit 704 and adjusting unit 705, among them:  The receiving unit 704, Receiving touch commands sent by the user, The touch instruction is used to change a display state of the touched view component;  The adjusting unit 705, When it is determined that the display state of the touched view component is a contracted state, Adjusting a display state of the touched view component from a contracted state to an expanded state;  When it is determined that the display state of the touched view component is an expanded state, Adjusting the display state of the touched view component from an expanded state to a contracted state.  In another embodiment of the present disclosure, The adjusting unit 705 adjusts the display state of the touched view component from a contracted state to an expanded state. include:  Call ValueAnimatorSet, Based on the display position of the touched view component and the set height attribute value, Expanding the touched view component to a height corresponding to a set height attribute value, It is considered that the display state of the touched view component is adjusted from a contracted state to an expanded state.  In another embodiment of the present disclosure, The adjusting unit 705 before expanding the touched view component to a set height, Determining whether there are other view components in the layout container in an expanded state;  If it exists, Then, the display state of the other view components is adjusted from the expanded state to the contracted state.  In another embodiment of the present disclosure, After the adjustment unit 705 expands the touched view component to a set height, If the ValueAnimatorSet also contains texture property values, Then according to the texture attribute value, Dynamically displaying the texture state corresponding to the texture attribute value in the expanded touched view component.  In another embodiment of the present disclosure, The adjusting unit 705 adjusts the display state of the touched view component from a contracted state to an expanded state. include:  If the touched view component includes a mask layer, Then call TableView, Increasing a first display height of the touched view component;  According to the increased first display height, Adjusting the second display height of the mask layer, The second display height is the same as the first display height.  In another embodiment of the present disclosure, The adjusting unit 705, According to the layout logic and the first display height, Moving the position of the other view components located behind the touched view component down the first display height.  In another embodiment of the present disclosure, The layout device further includes: Loading unit 706, among them:  The loading unit 706, After adjusting the display state of the touched view component from the expanded state to the contracted state, When it is determined that a blank area appears, According to the layout logic in the layout container, Loading and displaying other view components in the blank area.   It should be noted, The layout device provided by the embodiment of the present invention can be implemented by software. It can also be implemented in hardware. There is no specific limit here. The layout device determines the first view component and the second view component included in the layout container; Loading displays the first view component and the second view component, The first view component and the second view component are in a stacked layout. That is, The technical solution provided by the embodiment of the present invention can effectively realize the cascading layout between different view components in the layout container. Effectively improve the user's visual effects, Compared to the tile layout, Increased compactness between different view components, When displaying a property of a product object, Allowing users to quickly determine the difference, Improve user experience with product objects.  FIG. 8 is a schematic structural diagram of a layout device of a view component according to an embodiment of the present disclosure. The layout device includes: Determining unit 801 and processing unit 802, among them:  Determining unit 801, Determining the first view component and the second view component contained in the layout container, The interval between the first view component and the second view component is a negative value;  Processing unit 802, Loading displays the first view component and the second view component, The first view component and the second view component are in a stacked layout.  In another embodiment of the present disclosure, The layout device further includes: Receiving unit 803 and adjusting unit 804, among them:  The receiving unit 803, Receiving touch commands sent by the user, The touch instruction is used to change a display state of the touched view component;  The adjusting unit 804, When it is determined that the display state of the touched view component is a contracted state, Adjusting a display state of the touched view component from a contracted state to an expanded state;  When it is determined that the display state of the touched view component is an expanded state, Adjusting the display state of the touched view component from an expanded state to a contracted state.  In another embodiment of the present disclosure, The adjusting unit 804 adjusts the display state of the touched view component from a contracted state to an expanded state. include:  Call ValueAnimatorSet, Based on the display position of the touched view component and the set height attribute value, Expanding the touched view component to a height corresponding to a set height attribute value, It is considered that the display state of the touched view component is adjusted from a contracted state to an expanded state.  In another embodiment of the present disclosure, The adjusting unit 804, Before expanding the touched view component to a set height, Determining whether there are other view components in the layout container in an expanded state;  If it exists, Then, the display state of the other view components is adjusted from the expanded state to the contracted state.  In another embodiment of the present disclosure, The adjusting unit 804, After the touched view component is expanded to a set height, If the ValueAnimatorSet also contains texture property values, Then according to the texture attribute value, Dynamically displaying the texture state corresponding to the texture attribute value in the expanded touched view component.   It should be noted, The layout device provided by the embodiment of the present invention can be implemented by software. It can also be implemented in hardware. There is no specific limit here. The layout device can effectively realize the cascading layout between different view components in the layout container through the technical solution provided by the embodiment of the present invention. Effectively improve the user's visual effects, Compared to the tile layout, Increased compactness between different view components, When displaying a property of a product object, Allowing users to quickly determine the difference, Improve user experience with product objects.  FIG. 9 is a schematic structural diagram of a layout device of a view component according to an embodiment of the present disclosure. The layout device includes: Determining unit 901 and processing unit 902, among them:  Determining unit 901, Determining the first view component and the second view component contained in the layout container, Creating a mask layer according to the set path on the first view component and the second view component;  Processing unit 902, Loading displays the first view component and the second view component, The first view component and the second view component are in a stacked layout.  In another embodiment of the present disclosure, The set path is:  A (0, R) -> B (W2, R) -> C (W1, R) -> D (W1, H+R)—>E(W2, H+R)—>F(0, H+R)—>A(0, a closed curve of R);   among them, Taking the top left vertex of the border of the first view component as the origin of the coordinate system, AB forms a convex curve with the upper frame of the first view component, BC, CD and DE are line segments, The EF forms a convex curve with the lower frame of the first view component. R is the radius of the convex curve, W1 is the width of the border of the first view component, W2 is the width of the convex curve, H is the height of the border of the first view component.  In another embodiment of the present disclosure, The layout device further includes: Receiving unit 903 and adjusting unit 904, among them:  The receiving unit 903, Receiving touch commands sent by the user, The touch instruction is used to change a display state of the touched view component;  The adjusting unit 904, When it is determined that the display state of the touched view component is a contracted state, Adjusting a display state of the touched view component from a contracted state to an expanded state;  When it is determined that the display state of the touched view component is an expanded state, Adjusting the display state of the touched view component from an expanded state to a contracted state.  In another embodiment of the present disclosure, The adjusting unit 904 adjusts the display state of the touched view component from a contracted state to an expanded state. include:  If the touched view component includes a mask layer, Then call TableView, Increasing a first display height of the touched view component;  According to the increased first display height, Adjusting the second display height of the mask layer, The second display height is the same as the first display height.  In another embodiment of the present disclosure, The adjusting unit 904, According to the layout logic and the first display height, Moving the position of the other view components located behind the touched view component down the first display height.  In another embodiment of the present disclosure, The layout device further includes: Loading unit 905, among them:  The loading unit 905, After adjusting the display state of the touched view component from the expanded state to the contracted state, When it is determined that a blank area appears, According to the layout logic in the layout container, Loading and displaying other view components in the blank area.   It should be noted, The layout device provided by the embodiment of the present invention can be implemented by software. It can also be implemented in hardware. There is no specific limit here. The layout device can effectively realize the cascading layout between different view components in the layout container through the technical solution provided by the embodiment of the present invention. Effectively improve the user's visual effects, Compared to the tile layout, Increased compactness between different view components, When displaying a property of a product object, Allowing users to quickly determine the difference, Improve user experience with product objects.  Those skilled in the art should understand that Embodiments of the invention may be provided as a method, system, Or a computer program product. therefore, The invention can adopt a completely hardware embodiment, Full software embodiment, Or in the form of an embodiment combining soft and hardware aspects. and, The present invention may employ computer usable storage media (including but not limited to disk storage, in one or more of the computer usable code contained therein. CD-ROM, The form of computer program product implemented on optical memory, etc.).  The present invention is directed to a method in accordance with an embodiment of the present invention, Equipment (system), And a flowchart and/or block diagram of a computer program product. It will be understood that each of the processes and/or blocks in the flowcharts and/or block diagrams can be implemented by computer program instructions. And a combination of processes and/or blocks in the flowcharts and/or block diagrams. These computer program instructions can be provided to a general purpose computer, Dedicated computer, An embedded processor or other processor of a programmable data processing device to produce a machine, The instructions executed by a processor of a computer or other programmable data processing device cause means for implementing the functions specified in one or more of the flow or blocks and/or blocks of the block diagram.  These computer program instructions can also be stored in computer readable memory that can boot a computer or other programmable data processing device to operate in a particular manner. Causing an instruction stored in the computer readable memory to produce an article of manufacture including the instruction device, The instruction means implements the functions specified in one or more flows of the flowchart or in a block or blocks of the flowchart.  These computer program instructions can also be loaded onto a computer or other programmable data processing device. Enabling a series of operational steps on a computer or other programmable device to produce computer-implemented processing, Thus, instructions executed on a computer or other programmable device provide steps for implementing the functions specified in one or more of the flow or the flow and/or block of the block.  In a typical configuration, The computing device includes one or more processors (CPUs), Input/output interface, Network interface and memory.  The memory may include non-permanent memory in a computer readable medium. In the form of random access memory (RAM) and/or non-volatile memory, Such as read only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer readable medium.  Computer readable media includes both permanent and non-permanent, Removable and non-removable media can be stored by any method or technique. The information can be computer readable instructions, Data structure, Program modules or other materials. Examples of computer storage media include, But 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, CD-ROM only read-only memory (CD-ROM), Digital versatile disc (DVD) or other optical storage, Magnetic cassette tape, Tape storage or other magnetic storage device or any other non-transportable media, Can be used to store information that can be accessed by a computing device. As defined in this article, The computer readable medium does not include a temporary storage computer readable medium (transitory media). Such as modulated data signals and carriers.  It should also be noted that The term "includes", "Include" or any other variation thereof is intended to cover a non-exclusive inclusion, Thus a process that includes a series of elements, method, Goods or equipment include not only those elements, It also includes other elements that are not explicitly listed. Or is it also included for this process, method, The elements inherent in the goods or equipment. Without more restrictions, An element defined by the statement "includes one..." Does not exclude the process of including the elements, method, There are additional identical elements in the item or device.  Those skilled in the art should understand that Embodiments of the present disclosure can be provided as a method, System or computer program product. therefore, This case can be implemented in a completely hardware embodiment. A fully software embodiment or a combination of embodiments of the software and hardware aspects. and, The present invention may employ computer-usable storage media (including but not limited to disk storage, in one or more of the computer-usable program code included therein. CD-ROM, The form of computer program product implemented on optical memory, etc.).  The above is only the embodiment of the present case. It is not intended to limit the case. For those skilled in the art, There are various changes and changes in this case. Any modifications made within the spirit and principles of the case, Equivalent replacement, Improvement, etc. All should be included in the scope of the patent application in this case.

701‧‧‧確定單元701‧‧‧determination unit

702‧‧‧處理單元702‧‧‧Processing unit

703‧‧‧繪製單元703‧‧‧ drawing unit

704‧‧‧接收單元704‧‧‧ receiving unit

705‧‧‧調整單元705‧‧‧Adjustment unit

706‧‧‧加載單元706‧‧‧Loading unit

801‧‧‧確定單元801‧‧‧determination unit

802‧‧‧處理單元802‧‧‧Processing unit

803‧‧‧接收單元803‧‧‧ receiving unit

804‧‧‧調整單元804‧‧‧Adjustment unit

901‧‧‧確定單元901‧‧‧determination unit

902‧‧‧處理單元902‧‧‧Processing unit

903‧‧‧接收單元903‧‧‧ Receiving unit

904‧‧‧調整單元904‧‧‧Adjustment unit

905‧‧‧加載單元905‧‧‧Loading unit

此處所說明的附圖用來提供對本案的進一步理解,構成本案的一部分,本案的示意性實施例及其說明用於解釋本案,並不構成對本案的不當限定。在附圖中:   圖1為現有技術中常見的平舖樣式的示意圖;   圖2為本案實施例提供的一種視圖組件的佈局方法的流程示意圖;   圖2(a)為本案實施例提供的一種視圖組件的繪製路徑的示意圖;   圖2(b)為本案實施例提供的一種視圖組件的繪製路徑的示意圖;   圖3為本案實施例提供的一種層疊式佈局的示意圖;   圖3(a)為本案實施例圖3所示的層疊式佈局中視圖組件的展開狀態示意圖;   圖3(b)為本案實施例圖3所示的層疊式佈局中視圖組件的收縮狀態示意圖;   圖4為本案實施例提供的另一種層疊式佈局的示意圖;   圖4(a)為本案實施例圖4所示的層疊式佈局中視圖組件的展開狀態示意圖;   圖4(b)為本案實施例圖4所示的層疊式佈局中視圖組件的收縮狀態示意圖;   圖5為本案實施例提供的一種視圖組件的佈局方法的流程示意圖;   圖6為本案實施例提供的一種視圖組件的佈局方法的流程示意圖;   圖7為本案實施例提供的一種視圖組件的佈局設備的結構示意圖;   圖8為本案實施例提供的一種視圖組件的佈局設備的結構示意圖;   圖9為本案實施例提供的一種視圖組件的佈局設備的結構示意圖。The drawings described herein are provided to provide a further understanding of the present invention and constitute a part of the present invention. The illustrative embodiments of the present invention and the description thereof are used to explain the present invention and do not constitute an undue limitation of the present invention. In the drawings: FIG. 1 is a schematic diagram of a tile pattern commonly seen in the prior art; FIG. 2 is a schematic flow chart of a layout method of a view component according to an embodiment of the present invention; FIG. 2(a) is a view provided by an embodiment of the present invention. FIG. 2(b) is a schematic diagram of a drawing path of a view component provided by an embodiment of the present invention; FIG. 3 is a schematic diagram of a stacked layout provided by an embodiment of the present invention; FIG. 3(a) is an implementation of the present invention. FIG. 3(b) is a schematic view showing the contracted state of the view component in the stacked layout shown in FIG. 3 according to the embodiment of the present invention; FIG. 4 is a schematic view of the embodiment of the present invention. Figure 4 (a) is a schematic view showing the unfolded state of the view component in the stacked layout shown in Figure 4 of the present embodiment; Figure 4 (b) is a stacked layout shown in Figure 4 of the embodiment of the present invention; Schematic diagram of the contraction state of the middle view component; FIG. 5 is a schematic flow chart of a layout method of the view component provided by the embodiment of the present invention 6 is a schematic flow chart of a layout component of a view component according to an embodiment of the present invention; FIG. 7 is a schematic structural diagram of a layout component of a view component according to an embodiment of the present invention; FIG. 8 is a layout device of a view component according to an embodiment of the present disclosure; FIG. 9 is a schematic structural diagram of a layout device of a view component according to an embodiment of the present invention.

Claims (27)

一種視圖組件的佈局方法,其特徵在於,包括:   確定佈局容器中包含的第一視圖組件和第二視圖組件;   加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。A layout method of a view component, comprising: determining a first view component and a second view component included in a layout container; loading and displaying the first view component and the second view component, the first view The component and the second view component are in a stacked layout. 根據申請專利範圍第1項所述的佈局方法,其中,在確定佈局容器中包含的第一視圖組件和第二視圖組件之前,所述方法還包括:   繪製第一視圖組件和第二視圖組件。The layout method of claim 1, wherein before determining the first view component and the second view component included in the layout container, the method further comprises: drawing the first view component and the second view component. 根據申請專利範圍第2項所述的佈局方法,其中,繪製第一視圖組件和第二視圖組件,包括:   繪製第一視圖組件的邊框和第二視圖組件的邊框;   調用類目間隔Item Decoration,將所述第一視圖組件與所述第二視圖組件之間的間隔設置為負值。The layout method of claim 2, wherein the drawing the first view component and the second view component comprises: drawing a border of the first view component and a border of the second view component; calling the category interval Item Decoration, The interval between the first view component and the second view component is set to a negative value. 根據申請專利範圍第3項所述的佈局方法,其中,所述方法還包括:   若所述第一視圖組件的邊框的樣式和所述第二視圖組件的邊框的樣式為上邊框的左上角/右上角凸起的矩形,那麽將所述第一視圖組件與所述第二視圖組件之間的間隔的大小值設置為凸起的高度。The layout method of claim 3, wherein the method further comprises: if a style of a border of the first view component and a style of a border of the second view component are an upper left corner of the upper border/ A raised rectangle in the upper right corner, then the size of the interval between the first view component and the second view component is set to the height of the bump. 根據申請專利範圍第2項所述的佈局方法,其中,繪製第一視圖組件,包括:   繪製第一視圖組件的邊框,所述邊框為矩形;   在所述第一視圖組件上按照設定路徑創建 CAShapeLayer,所述CAShapeLayer為所述第一視圖組件的蒙層。The layout method of claim 2, wherein the drawing the first view component comprises: drawing a border of the first view component, the border being a rectangle; creating a CAShapeLayer according to the set path on the first view component The CAShapeLayer is a layer of the first view component. 根據申請專利範圍第5項所述的佈局方法,其中,所述設定路徑為:   A(0,R)—〉B(W2,R)—〉C(W1,R)—〉D(W1,H+R)—〉E(W2,H+R)—〉F(0,H+R)—〉A(0,R)的閉合曲線;   其中,以所述第一視圖組件的邊框的左上角頂點為座標系的原點,AB與所述第一視圖組件的上邊框形成凸起曲線,BC、CD和DE為線段,EF與所述第一視圖組件的下邊框形成凸起曲線,R為凸起曲線的半徑,W1為所述第一視圖組件的邊框的寬度,W2為凸起曲線的寬度,H為所述第一視圖組件的邊框的高度。The layout method according to claim 5, wherein the set path is: A(0, R) -> B(W2, R) -> C(W1, R) -> D (W1, H +R)—>E(W2,H+R)—>F(0,H+R)—>A (0,R) closed curve; wherein, the top left corner of the border of the first view component For the origin of the coordinate system, AB forms a convex curve with the upper frame of the first view component, BC, CD, and DE are line segments, and EF forms a convex curve with the lower frame of the first view component, and R is convex. The radius of the curve, W1 is the width of the frame of the first view component, W2 is the width of the convex curve, and H is the height of the frame of the first view component. 根據申請專利範圍第1項所述的佈局方法,其中,所述方法還包括:   接收用戶發送的觸控指令,所述觸控指令用於變更被觸控的視圖組件的顯示狀態;   在確定所述被觸控的視圖組件的顯示狀態為收縮狀態時,將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態;   在確定所述被觸控的視圖組件的顯示狀態為展開狀態時,將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態。The method of claim 1, wherein the method further comprises: receiving a touch command sent by a user, wherein the touch command is used to change a display state of the touched view component; When the display state of the touched view component is a contracted state, the display state of the touched view component is adjusted from a contracted state to an expanded state; determining that the displayed state of the touched view component is expanded In the state, the display state of the touched view component is adjusted from the expanded state to the contracted state. 根據申請專利範圍第7項所述的佈局方法,其中,將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態,包括:   調用ValueAnimatorSet,基於所述被觸控的視圖組件的顯示位置和設置的高度屬性值,將所述被觸控的視圖組件展開設定高度屬性值對應的高度,視為將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態。According to the layout method of claim 7, wherein the display state of the touched view component is adjusted from a contracted state to an expanded state, including: calling a ValueAnimatorSet based on the touched view component Displaying the position and the set height attribute value, and expanding the height corresponding to the set height attribute value by the touched view component is regarded as adjusting the display state of the touched view component from the contracted state to the expanded state. 根據申請專利範圍第8項所述的佈局方法,其中,在將所述被觸控的視圖組件展開設定高度前,所述方法還包括:   確定所述佈局容器中是否存在其他視圖組件處於展開狀態;   若存在,則將所述其他視圖組件的顯示狀態由展開狀態調整為收縮狀態。The layout method of claim 8, wherein before the displaying the touched view component is expanded to a set height, the method further comprises: determining whether other view components are in an expanded state in the layout container. ; If present, adjusts the display state of the other view components from the expanded state to the collapsed state. 根據申請專利範圍第8項所述的佈局方法,其中,在將所述被觸控的視圖組件展開設定高度後,所述方法還包括:   若ValueAnimatorSet中還包含紋理屬性值,那麽根據所述紋理屬性值,在展開的所述被觸控的視圖組件中動態顯示所述紋理屬性值對應的紋理狀態。The layout method of claim 8, wherein after the touched view component is expanded to a set height, the method further comprises: if the ValueAnimatorSet further includes a texture attribute value, according to the texture The attribute value dynamically displays the texture state corresponding to the texture attribute value in the expanded touched view component. 根據申請專利範圍第7項所述的佈局方法,其中,將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態,包括:   若所述被觸控的視圖組件中包含蒙層,那麽調用TableView,增加所述被觸控的視圖組件的第一顯示高度;   根據增加的第一顯示高度,調整所述蒙層的第二顯示高度,所述第二顯示高度與所述第一顯示高度相同。According to the layout method of claim 7, wherein the display state of the touched view component is adjusted from a contracted state to an expanded state, including: if the touched view component includes a mask layer And then calling the TableView to increase the first display height of the touched view component; adjusting the second display height of the mask according to the increased first display height, the second display height and the first The display height is the same. 根據申請專利範圍第11項所述的佈局方法,其中,所述方法還包括:   根據佈局邏輯和所述第一顯示高度,將位於所述被觸控的視圖組件之後的其他視圖組件的位置向下移動所述第一顯示高度。The layout method of claim 11, wherein the method further comprises: positioning the other view components located behind the touched view component according to the layout logic and the first display height Moving the first display height downward. 根據申請專利範圍第7項所述的佈局方法,其中,在將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態後,所述方法還包括:   在確定有空白區域出現時,根據所述佈局容器中的佈局邏輯,在所述空白區域中加載顯示其他視圖組件。According to the layout method of claim 7, wherein after the display state of the touched view component is adjusted from the expanded state to the contracted state, the method further includes: when determining that a blank area appears Displaying other view components in the blank area according to layout logic in the layout container. 一種視圖組件的佈局方法,其特徵在於,包括:   確定佈局容器中包含的第一視圖組件和第二視圖組件,所述第一視圖組件與所述第二視圖組件之間的間隔為負值;   加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。A layout method of a view component, comprising: determining a first view component and a second view component included in a layout container, wherein a spacing between the first view component and the second view component is a negative value; Loading displays the first view component and the second view component, the first view component and the second view component being in a stacked layout. 根據申請專利範圍第14項所述的佈局方法,其中,所述方法還包括:   接收用戶發送的觸控指令,所述觸控指令用於變更被觸控的視圖組件的顯示狀態;   在確定所述被觸控的視圖組件的顯示狀態為收縮狀態時,將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態;   在確定所述被觸控的視圖組件的顯示狀態為展開狀態時,將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態。The method of claim 14, wherein the method further comprises: receiving a touch command sent by a user, wherein the touch command is used to change a display state of the touched view component; When the display state of the touched view component is a contracted state, the display state of the touched view component is adjusted from a contracted state to an expanded state; determining that the displayed state of the touched view component is expanded In the state, the display state of the touched view component is adjusted from the expanded state to the contracted state. 根據申請專利範圍第15項所述的佈局方法,其中,將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態,包括:   調用ValueAnimatorSet,基於所述被觸控的視圖組件的顯示位置和設置的高度屬性值,將所述被觸控的視圖組件展開設定高度屬性值對應的高度,視為將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態。According to the layout method of claim 15, wherein the display state of the touched view component is adjusted from a contracted state to an expanded state, comprising: calling a ValueAnimatorSet based on the touched view component Displaying the position and the set height attribute value, and expanding the height corresponding to the set height attribute value by the touched view component is regarded as adjusting the display state of the touched view component from the contracted state to the expanded state. 根據申請專利範圍第16項所述的佈局方法,其中,在將所述被觸控的視圖組件展開設定高度前,所述方法還包括:   確定所述佈局容器中是否存在其他視圖組件處於展開狀態;   若存在,則將所述其他視圖組件的顯示狀態由展開狀態調整為收縮狀態。The layout method of claim 16, wherein before the displaying the touched view component is expanded to a set height, the method further comprises: determining whether other view components are in an expanded state in the layout container. ; If present, adjusts the display state of the other view components from the expanded state to the collapsed state. 根據申請專利範圍第16項所述的佈局方法,其中,在將所述被觸控的視圖組件展開設定高度後,所述方法還包括:   若ValueAnimatorSet中還包含紋理屬性值,那麽根據所述紋理屬性值,在展開的所述被觸控的視圖組件中動態顯示所述紋理屬性值對應的紋理狀態。The layout method of claim 16, wherein after the touched view component is expanded to a set height, the method further comprises: if the ValueAnimatorSet further includes a texture attribute value, according to the texture The attribute value dynamically displays the texture state corresponding to the texture attribute value in the expanded touched view component. 一種視圖組件的佈局方法,其特徵在於,包括:   確定佈局容器中包含的第一視圖組件和第二視圖組件,所述第一視圖組件和所述第二視圖組件上按照設定路徑創建蒙層;   加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。A layout method of a view component, comprising: determining a first view component and a second view component included in a layout container, wherein the first view component and the second view component create a mask layer according to a set path; Loading displays the first view component and the second view component, the first view component and the second view component being in a stacked layout. 根據申請專利範圍第19項所述的佈局方法,其中,所述設定路徑為:   A(0,R)—〉B(W2,R)—〉C(W1,R)—〉D(W1,H+R)—〉E(W2,H+R)—〉F(0,H+R)—〉A(0,R)的閉合曲線;   其中,以所述第一視圖組件的邊框的左上角頂點為座標系的原點,AB與所述第一視圖組件的上邊框形成凸起曲線,BC、CD和DE為線段,EF與所述第一視圖組件的下邊框形成凸起曲線,R為凸起曲線的半徑,W1為所述第一視圖組件的邊框的寬度,W2為凸起曲線的寬度,H為所述第一視圖組件的邊框的高度。The layout method according to claim 19, wherein the set path is: A(0, R) -> B(W2, R) -> C(W1, R) -> D (W1, H +R)—>E(W2,H+R)—>F(0,H+R)—>A (0,R) closed curve; wherein, the top left corner of the border of the first view component For the origin of the coordinate system, AB forms a convex curve with the upper frame of the first view component, BC, CD, and DE are line segments, and EF forms a convex curve with the lower frame of the first view component, and R is convex. The radius of the curve, W1 is the width of the frame of the first view component, W2 is the width of the convex curve, and H is the height of the frame of the first view component. 根據申請專利範圍第19項所述的佈局方法,其中,所述方法還包括:   接收用戶發送的觸控指令,所述觸控指令用於變更被觸控的視圖組件的顯示狀態;   在確定所述被觸控的視圖組件的顯示狀態為收縮狀態時,將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態;   在確定所述被觸控的視圖組件的顯示狀態為展開狀態時,將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態。The method of claim 19, wherein the method further comprises: receiving a touch command sent by a user, the touch command being used to change a display state of the touched view component; When the display state of the touched view component is a contracted state, the display state of the touched view component is adjusted from a contracted state to an expanded state; determining that the displayed state of the touched view component is expanded In the state, the display state of the touched view component is adjusted from the expanded state to the contracted state. 根據申請專利範圍第21項所述的佈局方法,其中,將所述被觸控的視圖組件的顯示狀態由收縮狀態調整為展開狀態,包括:   若所述被觸控的視圖組件中包含蒙層,那麽調用TableView,增加所述被觸控的視圖組件的第一顯示高度;   根據增加的第一顯示高度,調整所述蒙層的第二顯示高度,所述第二顯示高度與所述第一顯示高度相同。The layout method according to claim 21, wherein the display state of the touched view component is adjusted from a contracted state to an expanded state, including: if the touched view component includes a mask layer And then calling the TableView to increase the first display height of the touched view component; adjusting the second display height of the mask according to the increased first display height, the second display height and the first The display height is the same. 根據申請專利範圍第22項所述的佈局方法,其中,所述方法還包括:   根據佈局邏輯和所述第一顯示高度,將位於所述被觸控的視圖組件之後的其他視圖組件的位置向下移動所述第一顯示高度。The layout method according to claim 22, wherein the method further comprises: positioning a position of the other view component located behind the touched view component according to the layout logic and the first display height Moving the first display height downward. 根據申請專利範圍第21項所述的佈局方法,其中,在將所述被觸控的視圖組件的顯示狀態由展開狀態調整為收縮狀態後,所述方法還包括:   在確定有空白區域出現時,根據所述佈局容器中的佈局邏輯,在所述空白區域中加載顯示其他視圖組件。According to the layout method of claim 21, after the display state of the touched view component is adjusted from the expanded state to the contracted state, the method further includes: when determining that a blank area occurs Displaying other view components in the blank area according to layout logic in the layout container. 一種視圖組件的佈局設備,其特徵在於,包括:   確定單元,確定佈局容器中包含的第一視圖組件和第二視圖組件;   處理單元,加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。A layout device of a view component, comprising: a determining unit, determining a first view component and a second view component included in a layout container; a processing unit, loading and displaying the first view component and the second view component The first view component and the second view component are in a stacked layout. 一種視圖組件的佈局設備,其特徵在於,包括:   確定單元,確定佈局容器中包含的第一視圖組件和第二視圖組件,所述第一視圖組件與所述第二視圖組件之間的間隔為負值;   處理單元,加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。A layout device of a view component, comprising: a determining unit, determining a first view component and a second view component included in a layout container, wherein an interval between the first view component and the second view component is a processing unit that loads and displays the first view component and the second view component, the first view component and the second view component being in a stacked layout. 一種視圖組件的佈局設備,其特徵在於,包括:   確定單元,確定佈局容器中包含的第一視圖組件和第二視圖組件,所述第一視圖組件和所述第二視圖組件上按照設定路徑創建蒙層;   處理單元,加載顯示所述第一視圖組件和所述第二視圖組件,所述第一視圖組件與所述第二視圖組件呈層疊式佈局。A layout device of a view component, comprising: a determining unit, determining a first view component and a second view component included in a layout container, wherein the first view component and the second view component are created according to a set path a processing unit that loads and displays the first view component and the second view component, the first view component and the second view component being in a stacked layout.
TW107125844A 2017-08-24 2018-07-26 Layout method and device for view component TW201913351A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710733304.2A CN109426495A (en) 2017-08-24 2017-08-24 A kind of layout method and equipment of view component
??201710733304.2 2017-08-24

Publications (1)

Publication Number Publication Date
TW201913351A true TW201913351A (en) 2019-04-01

Family

ID=65438414

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107125844A TW201913351A (en) 2017-08-24 2018-07-26 Layout method and device for view component

Country Status (3)

Country Link
CN (1) CN109426495A (en)
TW (1) TW201913351A (en)
WO (1) WO2019037636A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114443198B (en) * 2022-01-26 2024-03-29 阿里巴巴(中国)有限公司 View assembly management method, device, storage medium and computer program product

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541537B (en) * 2011-12-01 2014-12-31 厦门雅迅网络股份有限公司 Method and device for realizing menu container controls with surrounding effect
CN102830972A (en) * 2012-08-14 2012-12-19 管重 Multi-webpage browsing device of internet browser
CN103488383B (en) * 2013-09-27 2017-01-04 深圳市金立通信设备有限公司 A kind of interface operation method and terminal unit
CN103631865B (en) * 2013-11-01 2017-09-22 北京奇虎科技有限公司 Webpage generating method and equipment
CN104050274A (en) * 2014-06-25 2014-09-17 国家电网公司 HTML page nesting method and device
CN105843494B (en) * 2015-01-15 2020-06-09 中兴通讯股份有限公司 Method, device and terminal for realizing area screen capture
CN105955598A (en) * 2016-05-04 2016-09-21 深圳市凯立德科技股份有限公司 Interface display method and apparatus

Also Published As

Publication number Publication date
WO2019037636A1 (en) 2019-02-28
CN109426495A (en) 2019-03-05

Similar Documents

Publication Publication Date Title
US9349205B2 (en) Systems and methods for animating between collection views
US20100235769A1 (en) Smooth layout animation of continuous and non-continuous properties
TW201730846A (en) Method and device for realizing color tween animation
US11288853B2 (en) Systems and methods of providing enhanced product visualization on a graphical display
CN103064592B (en) A kind of prolongable menu display method
EP3198411B1 (en) View management architecture
CN107908341B (en) Image display method, system, computer-readable storage medium, and computer device
TW201913351A (en) Layout method and device for view component
CN105812881A (en) User interface window processing method and system and television set
TW201541332A (en) Animating content display
US9396581B2 (en) Contact shadows in visual representations
CN111210486B (en) Method and device for realizing streamer effect
Nam et al. SPACESKETCH: Shape modeling with 3D meshes and control curves in stereoscopic environments
US11887255B2 (en) Method and system for rendering boundary of map area within game map, and computer-readable storage medium
WO2023159595A9 (en) Method and device for constructing and configuring three-dimensional space scene model, and computer program product
CN107102832B (en) The display methods and device of figure in chart
JP2019121238A (en) Program, image processing method, and image processing device
CN114429511A (en) Fusion rendering method and device, computer equipment and storage medium
AU2017212441B2 (en) Haptic correlated graphic effects
JP3062488B1 (en) Texture mapping apparatus, method, and recording medium
CN110120089A (en) A kind of seamless texture automatic generation method based on clipping boundary optimization
CN102074030A (en) Method for acquiring and editing custom graphics and system for making subtitle graphics
TWI410890B (en) Method and apparatus emulating branch structure
TWI724096B (en) Processing method, device and smart terminal for interface operation
Gai et al. Optimization Strategies for Real-Time Rendering of Virtual Scenes on Heterogeneous Mobile Devices