Containers in Power Apps.
We have all tried to build responsive apps, failed and then stuck to the same default layout.
Microsoft now has introduced containers in Power Apps. With containers MS has also introduced few new control properties. These properties are dependent on the direction property. So what does that mean. It means now you can develop apps by inserting controls inside these containers and you don't have to worry about responsiveness. Consider these containers as responsive wrapper around your App.
Before this i use to leverage power apps forms control to achieve this, setting the height and with to App.Height and App.Width.
So lets set first the app settings set. First of all we need to turn off the below features.
Now if you come inside the app you, lets add a container to your screen. The most basic one is the one in which you add a screen and then add container as an input control.
Property like Direction has two values Horizontal and Vertical. Now the below properties have a cascading effect as to what value you set for this Property.
Like if we insert 3 icons inside the container and set the direction property as horizontal, Justify propery as left and Align to Start as in the above diagram. We have the below result. i have set the flexible width property of the middle icon, and that is the reason you see it covering most part of the screen.
now if we just change the Direction property to Vertical.
Also, if you turn back the direction to Horizontal and reduce the size of the window you will see the yellow icon with flexible width reduces the width as per the app width.
Another important property is Wrap. This is disabled by default, but if you set it on and add new icons on the container you will see the wrapping effect on the controls. And when you reduce the size of the windows the controls automatically move to the next row.There are also Screen container options to use in PowerApps. And by default all these screens are responsive. So if you add in controls with relative values.Creating Responsive Apps becomes easy.
I am sure, all this is just a beginning in the right direction and MS will soon add in more properties and features to leverage. Also with the introduction of Power FX the future looks very responsive.
As we already have a list of known issues. :)
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/build-responsive-apps
Comments
Post a Comment