<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>]]>
您通常在 MXML 文件中定义 SplashScreenImage 类。使用 SplahsScreenImageSource 类来定义不同的图像选择和相应的设备配置。然后,将应用程序的
确定与移动设备最匹配的 SplahsScreenImageSource 定义的过程如下:
注意::此类不能在应用程序的 MXML 中以内联方式设置。您必须在一个单独的 MXML 文件中定义它并使用应用程序的
您不要直接调用此方法,它由 Flex 内部调用。
如果您想覆盖选取 SplashScreenImageSource 最佳匹配实例的默认 Flex 逻辑,请在 SplashScreenImage 组件中覆盖此方法。
<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" >]]>
您通常使用一个或多个 SplashScreenImageSource 对象来定义 MXML 中的 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>
如果未设置,则
NaN 值表示 SplashScreenImage 忽略该属性。
您可以使用此属性基于设备的像素分辨率显示不同的图像。
NaN 值表示 SplashScreenImage 忽略该属性。
例如:
<s:SplashScreenImageSource source="@Embed('assets/logo240Portrait.jpg')" dpi="240" aspectRatio="portrait"/>