You can override the default DPI mappings that scale your app to devices with 
different DPIs. In your Application MXML file, add this property:

runtimeDPIProvider="com.yournamehere.CustomRuntimeDPIProvider"

And implement a class that extends the default RuntimeDPIProvider. These are 
settings one of my apps actually uses (with a starting applicationDPI setting 
of 160. It makes the portrait only iphone layout look good on an iPad as well 
as some of the super hi res devices that are coming out.

public class CustomRuntimeDPIProvider extends RuntimeDPIProvider {

   override public function get runtimeDPI():Number {
      if (Capabilities.screenDPI > 550) {
         return DPIClassification.DPI_640;
      } else if (Capabilities.screenDPI > 400) {
         return DPIClassification.DPI_480;
      } else if (Capabilities.screenDPI > 250) {
         return DPIClassification.DPI_320;
      }
      return super.runtimeDPI;
   }
}

You can experiment to fine-tune the right scaling based on DPI and to find the 
right starting applicationDPI. But essentially, all your layouts and fonts will 
scale together based on the runtimeDPI settings. This allows you to develop for 
a single applicationDPI, and different devices with higher DPI will show larger 
fonts, etc.

On Mar 19, 2019, at 9:15 AM, agm65 <[email protected]> wrote:

Hi all,

what is the difference between runtimeDPI and application DPI?
I have some problems with very large displays like the google pixel2.

It runs with 480 dpi. Everything looks to small with my 480 dpi settings. If
i use the values for 640dpi it looks good.

Any idea? And where to find the multidpi gaps? 

thx alot!



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/


Reply via email to