Skip to content

Commit 4868f8d

Browse files
committed
Adding examples
1 parent c19133a commit 4868f8d

10 files changed

+105
-14
lines changed

powerapps-docs/maker/TOC.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@
403403
href: ./canvas-apps/controls/control-export-import.md
404404
- name: Gallery
405405
href: ./canvas-apps/controls/control-gallery.md
406-
- name: Horizontal container control
406+
- name: Horizontal container (experimental)
407407
href: ../canvas-apps/controls/control-horizontal-container.md
408408
- name: HTML text
409409
href: ./canvas-apps/controls/control-html-text.md
@@ -449,7 +449,7 @@
449449
href: ./canvas-apps/controls/control-timer.md
450450
- name: Toggle
451451
href: ./canvas-apps/controls/control-toggle.md
452-
- name: Vertical container control
452+
- name: Vertical container (experimental)
453453
href: ../canvas-apps/controls/control-vertical-container.md
454454
- name: Video
455455
href: ./canvas-apps/controls/control-audio-video.md

powerapps-docs/maker/canvas-apps/build-responsive-apps.md

Lines changed: 71 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ Before you start using the responsive layouts, you need to do the following:
6262
1. Open the app where you want to use the responsive layout.
6363
1. Go to **File** > **Settings** > **Screen size & orientation** to disable **Scale to fit**, **Lock aspect ratio**, and **Lock orientation** and select **Apply**.
6464

65-
![Settings disable lock orientation](media/create-responsive-layout/settings-disable-lock-orientation.png "Settings disable lock orientation")
65+
> [!div class="mx-imgBorder"]
66+
> ![Settings disable lock orientation](media/create-responsive-layout/settings-disable-lock-orientation.png "Settings disable lock orientation")
6667
6768
## Responsive layouts
6869

6970
The following responsive layouts can be created by adding a new screen and selecting the appropriate option from the **Layout** tab:
7071

71-
![Screen layouts](media/create-responsive-layout/different-screen-layouts.png "Screen layouts")
72+
> [!div class="mx-imgBorder"]
73+
> ![Screen layouts](media/create-responsive-layout/different-screen-layouts.png "Screen layouts")
7274
7375
### Split-screen
7476

@@ -78,7 +80,16 @@ The Split-screen layout has two sections, each occupying 50% width of the screen
7880

7981
The Sidebar layout has a fixed width sidebar on the left. The main body consists of a fixed height header, and the main section takes up the rest of the screen width. By default, the template has the same behavior on mobile, however some customizations are recommended based on the UI pattern desired for the mobile experience.
8082

81-
### Working with containers
83+
### Example
84+
85+
1. Sign in to [Power Apps](https://make.powerapps.com).
86+
1. Select **Apps** from left navigation. Select the **New app** drop down menu and then select **Canvas**.
87+
1. On the **Blank app** tile, select **Tablet layout**.
88+
1. Select **File** > **Settings** > **Screen size + orientation** and disable **Scale to fit**, **Lock aspect ratio**, and **Lock orientation** and select **Apply**.
89+
1. Select **New screen** and then select **Header, footer, main content** template screen.
90+
1. Select **MainSectionContainer1** and set the `Direction` property to `Horizontal`. Set `Align` to `Stretch`.
91+
92+
## Working with containers
8293

8394
Containers are building blocks of all the responsive design. A container can be an [auto-layout container](#auto-layout-containers) in vertical or horizontal direction, or a fixed-layout container, which in the future will support constraints.
8495

@@ -92,27 +103,77 @@ Below are some tips for building your app’s UI with containers:
92103

93104
Choose one of two layout modes for a container: Manual layout or auto-layout (Horizontal or Vertical)
94105

95-
### Auto-layout containers
106+
## Auto-layout containers
96107

97108
Two controls, [Horizontal container](controls/control-horizontal-container.md) and [Vertical container](controls/control-vertical-container.md) can be used to automatically lay out the child components. These containers determine the position of the child components so that you never have to set X, Y for a component inside the container. Also, it can distribute the available space to its child components based on the settings, as well as determines both the vertical and horizontal alignment of the child components.
98109

99-
#### When to use auto-layout containers
110+
### When to use auto-layout containers
100111

101112
You can use auto-layout containers in the following scenarios:
102113

103114
- UI needs to be responsive to screen size or form factor changes.
104-
105115
- There is more than one child component that needs to resize or move around based on the screen size or form factor changes.
106-
107116
- When you need to stack items vertically or horizontally (regardless of their size).
108-
109117
- When you need to space items evenly on the screen.
110118

119+
### Example for auto-layout container
120+
121+
To build a responsive screen:
122+
123+
1. Sign in to [Power Apps](https://make.powerapps.com).
124+
1. Select **Apps** from left navigation. Select the **New app** drop down menu and then select **Canvas**.
125+
1. On the **Blank app** tile, select **Tablet layout**.
126+
1. Select **File** > **Settings** > **Screen size + orientation** and disable **Scale to fit**, **Lock aspect ratio**, and **Lock orientation** and select **Apply**.
127+
1. Now from the **Insert** pane in the left sidebar, under **Layout**, select **Horizontal container**.
128+
129+
> [!div class="mx-imgBorder"]
130+
> ![Insert containers](media/create-responsive-layout/insert-containers.png "Insert containers")
131+
132+
1. The top most container needs to be sized to take the entire space with these properties. It will be the same size as the screen as it resizes.
133+
1. X = 0
134+
1. Y= 0
135+
1. Width = Parent.Width
136+
1. Height = Parent. Height
137+
138+
1. Now, from the **Insert** pane add two **Vertical containers** into the Horizontal container.
139+
140+
> [!div class="mx-imgBorder"]
141+
> ![Add vertical containers](media/create-responsive-layout/add-two-vertical-containers.png "Add vertical containers")
142+
143+
1. To make the containers fill the full vertical space, Select **Container1** and set the `Align (vertical)` property to `Stretch`.
144+
145+
> [!div class="mx-imgBorder"]
146+
> ![Align stretch](media/create-responsive-layout/align-property-stretch.png "Align stretch")
147+
148+
1. To divide the screen between the content, use the `Fill portions` property on the two child containers. The left container will take up 1/4 of the screen space.
149+
1. Select **Container2**. You'll see that the `Flexible width` property is turned on. Set the `Fill portions` to 1.
150+
1. Select **Container3**. You'll see that the `Flexible width` property is turned on. Set the `Fill portions` to 3.
151+
1. Select **Container2**. Set the `Fill = RGBA(56, 96, 178, 1)` property in the formula bar. Set `Align (horizontal)` to `Stretch`.
152+
1. Add few buttons to create a menu. Rename the buttons as needed.
153+
154+
> [!div class="mx-imgBorder"]
155+
> ![Add buttons](media/create-responsive-layout/add-buttons-to-container.png "Add buttons")
156+
157+
1. Select **Container3** and add a Horizontal container and turn off the `Flexible height` property. Set `Height` to 100. Set `Align (vertical)` to `Stretch`.
158+
1. Add some **Icons** into **Container4**. Change the icons to be different with the icon property.
159+
160+
> [!div class="mx-imgBorder"]
161+
> ![Add icons](media/create-responsive-layout/add-icons-to-container.png "Add icons")
162+
163+
1. Select **Container4**. Set the `Justify (horizontal)` property to `End`. Set the `Align (vertical)` to `Center`. Set `Gap` to 40 to create space between the icons.
164+
1. Select **Container3**. Set `Align (horizontal)` to `Stretch`. Set `Vertical Overflow` to `Scroll`.
165+
1. Add different **Label**, **Inputs**, **Media** until they extend beyond the container. Change the color of the rectangles to be different. You'll see a scroll bar to access the unseen content.
166+
167+
> [!div class="mx-imgBorder"]
168+
> ![Add different inputs](media/create-responsive-layout/add-different-inputs-media-icons.png "Add different inputs")
169+
170+
1. Select Preview or F5. Change the size of the browser window to see how your app adjusts to different screen sizes.
171+
111172
## Known issues
112173

113174
- Certain combinations of layout container properties are incompatible or can produce undesirable outputs, for example:
114-
- If the container’s `LayoutWrap` property is enabled, the `AlignInContainer` property setting is ignored on child controls.
115-
- If the container’s `LayoutWrap` property is disabled and the container’s primary-axis overflow is set to **Scroll** (Horizontal Overflow for Horizontal containers or Vertical Overflow for Vertical containers), it is recommended to set the `LayoutJustify` property to either **Start** or **Space Between**.
175+
- If the container’s `Wrap` property is enabled, the `Align` property setting is ignored on child controls.
176+
- If the container’s `Wrap` property is disabled and the container’s primary-axis overflow is set to **Scroll** (Horizontal Overflow for Horizontal containers or Vertical Overflow for Vertical containers), it is recommended to set the `Justify` property to either **Start** or **Space Between**.
116177
- The **Center** or **End** options can cause child controls inaccessible when the container is too small to display all the controls, even though the `Overflow` property is set to **Scroll**.
117178

118179
- You can’t resize or reposition the controls on the canvas app because the drag & drop controls are disabled in the layout containers. Instead, use the layout container properties to achieve the desired size and positioning. Control ordering can be changed via the **Tree view**, or by using the arrow keys as shortcuts.

powerapps-docs/maker/canvas-apps/controls/control-horizontal-container.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,19 @@ Horizontal container control determines the position of the child components so
7575

7676
## Example
7777

78-
78+
1. Sign in to [Power Apps](https://make.powerapps.com).
79+
1. Select **Apps** from left navigation. Select the **New app** drop down menu and then select **Canvas**.
80+
1. On the **Blank app** tile, select **Tablet layout**.
81+
1. Select **File** > **Settings** > **Screen size + orientation** and disable **Scale to fit**, **Lock aspect ratio**, and **Lock orientation** and select **Apply**.
82+
1. Now from the **Insert** pane in the left sidebar, under **Layout**, select **Horizontal container**.
83+
84+
> [!div class="mx-imgBorder"]
85+
> ![Insert containers](../media/create-responsive-layout/insert-containers.png "Insert containers")
86+
87+
1. Set the following properties to occupy the full available space of the screen:
88+
1. X = 0
89+
1. Y= 0
90+
1. Width = Parent.Width
91+
1. Height = Parent. Height
92+
93+
1. Add few buttons, text inputs, media, icons and select **F5** to see how the app adjusts to the screen changes.

powerapps-docs/maker/canvas-apps/controls/control-vertical-container.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,19 @@ Vertical container control determines the position of the child components so th
7575

7676
## Example
7777

78-
78+
1. Sign in to [Power Apps](https://make.powerapps.com).
79+
1. Select **Apps** from left navigation. Select the **New app** drop down menu and then select **Canvas**.
80+
1. On the **Blank app** tile, select **Tablet layout**.
81+
1. Select **File** > **Settings** > **Screen size + orientation** and disable **Scale to fit**, **Lock aspect ratio**, and **Lock orientation** and select **Apply**.
82+
1. Now from the **Insert** pane in the left sidebar, under **Layout**, select **Vertical container**.
83+
84+
> [!div class="mx-imgBorder"]
85+
> ![Insert containers](../media/create-responsive-layout/insert-containers.png "Insert containers")
86+
87+
1. Set the following properties to occupy the full available space of the screen:
88+
1. X = 0
89+
1. Y= 0
90+
1. Width = Parent.Width
91+
1. Height = Parent. Height
92+
93+
1. Add few buttons, text inputs, media, icons and select **F5** to see how the app adjusts to the screen changes.
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)