PowerApps 中的資源庫控制項Gallery control in PowerApps

包含其他控制項並顯示一組資料的控制項。A control that contains other controls and shows a set of data.


資源庫控制項可以顯示資料來源中的多筆記錄,而且每一筆記錄都可以包含多種類型的資料。A Gallery control can show multiple records from a data source, and each record can contain multiple types of data. 例如,資源庫控制項可以顯示多個連絡人,而其每個項目都會顯示包括每位連絡人的名稱、地址和電話號碼的連絡資訊。For example, a Gallery control can show multiple contacts with each item showing contact information that includes a name, an address, and a phone number for each contact. 每個資料欄位都會出現在資源庫控制項的不同控制項中,而且您可以在其範本中設定這些控制項。Each data field appears in a separate control within the Gallery control, and you can configure those controls in its template. 範本會顯示為資源庫內的第一個項目、顯示在水平/橫向的資源庫控制項左邊緣,以及顯示在垂直/直向的資源庫控制項頂端。The template appears as the first item inside the gallery, on the left edge of a Gallery control in horizontal/landscape orientation and at the top of a Gallery control in vertical/portrait orientation. 您在範本中進行的任何變更都會反映在整個資源庫控制項中。Any changes that you make in the template are reflected throughout the Gallery control.

提供預先定義的資源庫範本,以顯示影像、文字,以及具有變動高度項目的資源庫。Predefined Gallery templates for showing images, text as well as a gallery with variable height items are available.

主要屬性Key properties

預設 – 當應用程式啟動時,要在資源庫中選取之資料來源中的項目或記錄。Default – The item or record from the data source to be selected in the gallery when the app starts up.

Items – 出現在資源庫、清單或圖表等控制項中的資料來源。Items – The source of data that appears in a control such as a gallery, a list, or a chart.

Selected – 選取的項目。Selected – The selected item.

其他屬性Additional properties

AllItems – 資源庫中的所有項目,包括屬於資源庫範本一部分的其他控制項值。AllItems – All items in a gallery, including additional control values that are a part of the gallery's template.

BorderColor – 控制項框線的色彩。BorderColor – The color of a control's border.

BorderStyle – 決定控制項的框線為實線虛線點線BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.

BorderThickness – 控制項框線的粗細。BorderThickness – The thickness of a control's border.

DisplayMode – 控制項允許使用者輸入 (編輯)、只顯示資料 (檢視) 或者已停用 (停用)。DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).

Fill – 控制項的背景色彩。Fill – The background color of a control.

Height – 控制項的頂端和底部邊緣之間的距離。Height – The distance between a control's top and bottom edges.

Layout – 使用者從上到下 (水平) 還是從左到右 (垂直) 捲動資源庫或調整滑桿。Layout – Whether the user scrolls through a gallery or adjusts a slider top to bottom (Vertical) or left to right (Horizontal).

NavigationStep – 如果資源庫的 ShowNavigation 屬性設定為 true,而且使用者選取該資源庫任一端的導覽箭號,則資源庫會捲動多遠。NavigationStep – How far a gallery scrolls if its ShowNavigation property is set to true and the user selects a navigation arrow at either end of that gallery.

ShowNavigation – 箭號是否出現在資源庫的每一端,讓使用者可以按一下或點選箭號來捲動資源庫中的項目。ShowNavigation – Whether an arrow appears at each end of a gallery so that a user can scroll through the items in the gallery by clicking or tapping an arrow.

ShowScrollbar – 使用者將滑鼠指標停留在資源庫上方時是否顯示捲軸。ShowScrollbar – Whether a scrollbar appears when the user hovers over a gallery.

Snap – 使用者捲動資源庫時,是否自動貼齊,以完整顯示下一個項目。Snap – Whether, when a user scrolls through a gallery, it automatically snaps so that the next item appears in full.

TemplateFill – 資源庫的背景色彩。TemplateFill – The background color of a gallery.

TemplatePadding – 資源庫中項目之間的距離。TemplatePadding – The distance between items in a gallery.

TemplateSize – 資源庫中範本的垂直/直向高度,或資源庫中範本的水平/橫向寬度。TemplateSize – The height of the template for a gallery in vertical/portrait orientation or the width of the template for a gallery in horizontal/landscape orientation.

Transition – 使用者將滑鼠指標停留在資源庫中的項目上方時的視覺效果 (PopPushNone)。Transition – The visual effect (Pop, Push, or None) when the user hovers over an item in a gallery.

Visible – 控制項顯示或隱藏。Visible – Whether a control appears or is hidden.

Width – 控制項左邊緣與右邊緣之間的距離。Width – The distance between a control's left and right edges.

WrapCount – 根據水平或垂直配置的每個資料列或資料行所顯示的項目數。WrapCount – Number of items shown per row or column based on horizontal or vertical layout.

X – 控制項左邊緣與其父容器 (沒有父容器時則為螢幕) 左邊緣之間的距離。X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent container).

Y – 控制項上邊緣與其父容器 (沒有父容器時則為螢幕) 上邊緣之間的距離。Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent container).

Filter( DataSource, Formula )Filter( DataSource, Formula )


顯示和篩選資料Show and filter data

取得使用者的資料Get data from the user