
Been messing with this for an hour or two and embarrassed how lost I am...
I'm new to Power Apps. I would like the font size to change with the screen size. I can do that fine using this switch function:
Switch(App.ActiveScreen.Size, ScreenSize.Small, fontSmall, ScreenSize.Medium, fontMedium, ScreenSize.Large, fontLarge, ScreenSize.ExtraLarge, fontXL)
These font variables refer to a set of 4 variables I have tried defining in App.OnStart and this page's Screen.OnVisible. Both options leave all of the variables defined as blank. This is the code I have for those:
Set(fontSmall, 8);
Set(fontMedium, 12);
Set(fontLarge, 16);
Set(fontXL, 24);
Simple stuff! Yet I can't get my desired result... what am I getting wrong here? Is there a better way to approach this? Thanks.
In the design environment App.OnStart needs to be run manually from the App object context menu. When running the app in production it runs automatically. Until you do that in the designer those variables will be blank.
The OnVisible property is also somewhat unreliable in the Designer because it runs when the screen is first loaded by the designer, which was before you modified the OnVisible property. Again, this is less of a problem in the production version.