spark.preloadersSplashScreenImage 使用 SplashScreenImage 类基于移动设备的特性指定不同的启动屏幕图像。The <s:SplashScreenImage> tag inherits all of the tag attributes of its superclass and adds no new tag attributes:

  <s:SplashScreenImage xmlns:fx="http://ns.adobe.com/mxml/2009" 
      xmlns:s="library://ns.adobe.com/flex/spark">
  
      <!-- Define one or more SplashScreenImageSource. -->
      <s:SplashScreenImageSource 
          source="@Embed('assets/logoDefault.jpg')"/>
          
      <s:SplashScreenImageSource 
          source="@Embed('assets/logo240Portrait.jpg')"
          dpi="240" 
          aspectRatio="portrait"/>
   
  </s:SplashScreenImage>
  
]]>
mx.core:IMXMLObjectObject 使用 SplashScreenImage 类基于移动设备的特性指定不同的启动屏幕图像。例如,您可以基于设备的 DPI、方向或分辨率对一个启动屏幕使用不同的图像。

您通常在 MXML 文件中定义 SplashScreenImage 类。使用 SplahsScreenImageSource 类来定义不同的图像选择和相应的设备配置。然后,将应用程序的 splashScreenImage 属性设置为 SplashScreenImage MXML 组件的名称。

确定与移动设备最匹配的 SplahsScreenImageSource 定义的过程如下:

  1. 确定与移动设备的设置相匹配的所有 SplashScreenImageSource 定义。发生匹配的条件如下:
    • SplashScreenImageSource 定义未显式定义该设置。例如,不存在与任何设备的 DPI 相匹配的 dpi 属性设置。
    • 对于 dpiaspectRatio 属性,属性必须与相应的移动设备设置完全匹配。
    • 对于 minResolution 属性,当 Stage.stageWidthStage.stageHeight 属性中的较大者等于或大于 minResolution 时,属性与设备上的设置相匹配。
  2. 如果有一个以上的 SplashScreenImageSource 定义与设备相匹配,则:
    • 选择一个显式设置数目最大的定义。例如,同时指定了 dpiaspectRatio 属性的 SplashScreenImageSource 定义的匹配度高于仅指定 dpi 属性的定义。
    • 如果仍有多个匹配,则选择一个 minResolution 值最高的匹配项。
    • 如果仍有多个匹配,则选择组件中定义的第一个匹配项。

注意::此类不能在应用程序的 MXML 中以内联方式设置。您必须在一个单独的 MXML 文件中定义它并使用应用程序的 splashScreenImage 属性引用它。

spark.preloaders.SplashScreenImageSourcespark.components.Application.splashScreenImageSplashScreenImage 构造函数。 构造函数。 getImageClass 返回与指定的设备参数最匹配的 SplashScreenImageSource 的类。要显示为启动屏幕图像的图像的 Class。 aspectRatioflash.display.StageAspectRatio.PORTRAITflash.display.StageAspectRatio.LANDSCAPE,以两者中较大者为准。 dpi移动设备的 DPI。 resolution移动设备的更大尺寸的分辨率(以像素为单位)。 返回与指定的设备参数最匹配的 SplashScreenImageSource 的类。

您不要直接调用此方法,它由 Flex 内部调用。

如果您想覆盖选取 SplashScreenImageSource 最佳匹配实例的默认 Flex 逻辑,请在 SplashScreenImage 组件中覆盖此方法。

flash.display.StageAspectRatio
initialized 创建实现对象且初始化在 MXML 标签上指定的所有组件属性后调用。document创建此对象的 MXML 文档。 iddocument 用来引用此对象的标识符。如果此对象是 document 上的深层属性,则 id 为 null。 创建实现对象且初始化在 MXML 标签上指定的所有组件属性后调用。 mxmlContent SplashScreenImage 的 SplashScreenImageSource 源。 SplashScreenImage 的 SplashScreenImageSource 源。通常,您不要直接调用此方法。相反,您要以内联方式在 SplashScreenImage 组件的 MXML 文件中添加 SplashScreenImageSource 定义。
SplashScreenImageSource 使用 SplashScreenImageSource 类指定一个类(通常是一个嵌入式图像)将以特定的设备配置(如 DPI、方向和分辨率)显示为启动屏幕。The <s:SplashScreenImageSource> tag inherits all of the tag attributes of its superclass and adds the following tag attributes:

  <s:SplashScreenImageSource
   Properties
    aspectRatio="null"
    dpi="NaN"
    minResolution="NaN"
    source="null"
  >
  
]]>
Object 使用 SplashScreenImageSource 类指定一个类(通常是一个嵌入式图像)将以特定的设备配置(如 DPI、方向和分辨率)显示为启动屏幕。

您通常使用一个或多个 SplashScreenImageSource 对象来定义 MXML 中的 SplashScreenImage 类,并将应用程序的 splashScreenImage 属性设置为该类。

如下所示的 SplashScreenImage 组件对 SplashScreenImageSource 有三个不同的定义:

    <?xml version="1.0" encoding="utf-8"?> 
    <s:SplashScreenImage xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark"> 
     
        <!-- Default splashscreen image. --> 
        <s:SplashScreenImageSource 
            source="@Embed('assets/logoDefault.jpg')"/> 
        
        <s:SplashScreenImageSource 
            source="@Embed('assets/logo240Portrait.jpg')" 
            dpi="240" 
            aspectRatio="portrait"/> 
        
        <s:SplashScreenImageSource 
            source="@Embed('assets/logo240Landscape.jpg')" 
            dpi="240" 
            aspectRatio="landscape"/> 
        
    </s:SplashScreenImage>      
  
spark.preloaders.SplashScreenImagespark.components.Application.splashScreenImageSplashScreenImageSource 构造函数。 构造函数。 aspectRatio 所需的移动设备的高宽比。null 所需的移动设备的高宽比。此属性可以是 flash.display.StageAspectRatio.PORTRAITflash.display.StageAspectRatio.LANDSCAPE

如果未设置,则 SplashScreenImage 忽略此属性。

flash.display.StageAspectRatio
dpi 设备显示相关联的图像所需的 DPI。NaNNaN 设备显示相关联的图像所需的 DPI。

NaN 值表示 SplashScreenImage 忽略该属性。

minResolution 显示图像所需的移动设备分辨率的最小大小。NaNNaN 显示图像所需的移动设备分辨率的最小大小。设备分辨率是舞台宽度和高度的最大值(以像素为单位)。minResolution 属性的值与 Stage.stageWidthStage.stageHeight 属性中较大的属性值进行比较。这两个值中较大的值必须等于或大于 minResolution 属性。

您可以使用此属性基于设备的像素分辨率显示不同的图像。

NaN 值表示 SplashScreenImage 忽略该属性。

source 用于已定义设备配置的启动屏幕的图像类。null 用于已定义设备配置的启动屏幕的图像类。通常将该属性设置为嵌入资源。

例如:

            <s:SplashScreenImageSource 
                source="@Embed('assets/logo240Portrait.jpg')" 
                dpi="240" 
                aspectRatio="portrait"/> 
      
spark.preloaders.SplashScreenImage
SplashScreen SplashScreen 类是 Mobile Flex 应用程序的默认预加载器。mx.preloaders:IPreloaderDisplayflash.display:Sprite SplashScreen 类是 Mobile Flex 应用程序的默认预加载器。开发人员可以通过 Application 属性 splashScreenImagesplashScreenScaleModesplashScreenMinimumDisplayTime 指定图像类并调整模式大小。SplashScreen 监视设备方向并更新图像以便在屏幕上显示图像,好像方向始终为 StageOrientation.DEFAULT。 spark.components.Application.splashScreenImagespark.components.Application.splashScreenScaleModespark.components.Application.splashScreenMinimumDisplayTimeSplashScreen 构造函数。 构造函数。 initialize stageHeight stageWidth preloader