Jump to content
Stewag

FMX views: Which one is applied?

Recommended Posts

Since long I wonder, how the different views that I configured for iOS and Android form-factors apply to displays, that do not fit in.

For example, I saw at a friend's 6.5" Samsung that a "wrong" text size is used. I configured 5.8" and 6.8" views and would like to know which one (if any?) of the two was applied to the 6.5" device.

I tried to find a way to display the currently applied fmx view, e.g. by pressing a label but have found no way yet. Maybe this is not possible as events are inherited?

Or is there a way?

 

I use TGrindPanelLayout to evenly spread components over the screen but have found no way yet, to scale text size for displays from 3.5 to 10 Inch displays other than using views.

I'd be happy to abandon views and solve the text-size scaling problem with code. 

Any ideas for this out there?

Edited by Stewag

Share this post


Link to post

Drawing forms according to screen size is a nice feature when targeting a particular device model, but if it's for the general public, don't use it. FMX uses the source screen with the same width/height for a specified OS. Just 2 pixels wider and it returns to the default view (according to tests I did a long time ago).


It's preferable to draw our screens using the numerous layouts (grid, flow, layout) and alignments.

 

Think responsive, like for a web page.

 

If you draw your screen by pixel, use a TScaleLayout as a global container. It has a virtual size and a real size. You can use it to adapt the size of your content or add a zoom in / zoom out feature.

 

Look a "screens" samples in GetIt to see how Embarcadero suggest to use those features for classic screens in a mobile app.

Share this post


Link to post

Oh, I was not aware, that it is yours:classic_laugh:

I am even more thankful then!

 

Have you tested the behaviour with a mobile app for general usage? 

 

Edited by Stewag
  • Haha 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×