uap:VisualElements (Windows 10)

描述应用的视觉方面:其默认磁贴、徽标图像、文本和背景色、初始屏幕方向、初始屏幕和锁屏磁贴外观。

元素层次结构

<包>

    <应用程序>

         <应用程序>

              <uap:VisualElements>

语法

<uap:VisualElements
    DisplayName = 'A string with a value between 1 and 256 characters. This string is localizable.' 
    Description = 'A string between 1 and 2048 characters.'
    BackgroundColor = 'A three-byte hexadecimal number preceded by "#" or a named color. See Remarks for a list of named colors.'
    Square150x150Logo = 'A string between 1 and 256 characters in length that ends with ".jpg", ".png", or ".jpeg" that cannot contain these characters: <, >, :, ", |, ?, or *. In this string, the / and \ characters cannot be the first or last characters. Also, the string can contain / or \ but not both.'
    Square44x44Logo = 'A string between 1 and 256 characters in length that ends with ".jpg", ".png", or ".jpeg" that cannot contain these characters: <, >, :, ", |, ?, or *. In this string, the / and \ characters cannot be the first or last characters. Also, the string can contain / or \ but not both.'
    AppListEntry = 'An optional string that can have one of the following values: "default" or "none".' >

  <!-- Child elements -->
  uap:DefaultTile?
  & uap:LockScreen?
  & uap:SplashScreen?
  & uap:InitialRotationPreference?

</uap:VisualElements>

密钥

? 可选 (零个或一个) & 交错连接器 (可以按任意顺序出现)

特性和元素

属性

属性 说明 数据类型 必须 默认值
DisplayName 可向用户显示的应用的友好名称。 此字符串可本地化;有关详细信息 ,请参阅备注 值介于 1 到 256 个字符之间的字符串。 此字符串可本地化。
说明 应用的说明。 此字符串可本地化;有关详细信息 ,请参阅备注 一个介于 1 到 2048 个字符之间的字符串。
BackgroundColor 指定应用磁贴的背景色。 有关颜色名称,请参阅 “备注 ”部分。
Square150x150Logo 用作应用的“开始屏幕”媒体磁贴和任务切换器上的图像。 有关如何在此属性中指定图像的详细信息,请参阅 备注 长度介于 1 到 256 个字符之间的字符串,以 .jpg.png.jpeg 结尾,不能包含以下字符:<、、>:"|?*。 在此字符串中, /\ 字符不能是第一个或最后一个字符。 此外,字符串可以包含 或,\但不能同时包含/两者。
Square44x44Logo 用作应用的“开始屏幕”小磁贴和“所有应用列表”上的图像。 有关如何在此属性中指定图像的详细信息,请参阅 备注 长度介于 1 到 256 个字符之间的字符串,以 .jpg.png.jpeg 结尾,不能包含以下字符:<、、>:"|?*。 在此字符串中, /\ 字符不能是第一个或最后一个字符。 此外,字符串可以包含 或,\但不能同时包含/两者。
AppListEntry “所有应用列表”中的条目。 对于不需要“开始”菜单磁贴的入口点,选择“无”。 可具有以下值之一的可选字符串:“default”或“none”。 default

注意

此处指定的背景色也适用于以下项:

  • 任何应用拥有的对话框中的按钮颜色
  • 应用商店中的“应用说明”页

子元素

子元素 描述
uap:DefaultTile 表示“开始”屏幕上应用的默认磁贴。 首次安装应用时,在收到任何更新通知之前,会显示此磁贴。 当磁贴没有要显示的通知时,磁贴将还原到此默认值。
uap:InitialRotationPreference 描述应用为了获得最佳用户体验而希望显示的方向。 在可旋转的设备(如平板电脑)上,不会为此处未指定的方向重新绘制应用。 例如,如果应用仅 Landscape 指定和 LandscapeFlipped 方向,并且设备旋转到 Portrait 方向,则应用将不会旋转。
uap:LockScreen 定义锁屏界面上表示应用的锁屏提醒和通知,锁屏界面在系统锁定时显示。
uap:SplashScreen 定义初始屏幕的外观,初始屏幕在启动期间由应用显示。

注意

在无法旋转的设备上,应用可能会显示在该设备的默认方向中,并且应用的首选方向将被忽略。 但是,在激活了旋转锁的设备上,应用的首选旋转仍受支持。

为应用启动新会话时,这些方向首选项选项同时适用于 初始屏幕 和应用 UI。 可以在运行时通过 AutoRotationPreferences 属性更改首选项。

父元素

父元素 说明
应用程序 表示一个应用,该应用包含包中提供的一部分或全部功能。

注解

有关磁贴维度要求的详细信息,请参阅 磁贴大小

对于 Square150x150LogoSquare44x44Logo 图像,可以提供不同比例的图像,以便 Windows 可以为设备和屏幕分辨率选择最佳大小。 你还可以提供辅助功能的高对比度图像和本地化图像,以匹配不同的 UI 语言。 此功能还允许本地化 DisplayNameDescription 属性。 有关详细信息,请参阅 全球化 主题。

Applications/Application/Extensions/Extension/FileTypeAssociation/Logo Applications/Application/Extensions/Extension/Protocol/Logo

下面显示了两种类型的徽标图像的大小要求:

Image 属性 缩放 (图像大小(以像素) )
Applications/Application/VisualElements/@Square150x150Logo 100 (150x150)
250 (375x375)
Applications/Application/VisualElements/@Square44x44Logo 100 (44x44)
250 (110x110)
Applications/Application/VisualElements/@Tall150x310Logo 100 (150x310)
250 (375x775)

以下是支持的背景色名称:

aliceBlue
antiqueWhite
浅绿色
水绿色
azure
米黄色
橘黄色
black
blanchedAlmond
blue
blueViolet
棕色
burlyWood
cadetBlue
黄绿色
巧克力色
珊瑚色
cornflowerBlue
玉米丝色
深红色
蓝绿色
深蓝色
darkCyan
darkGoldenrod

darkGray
darkGreen
darkKhaki
darkMagenta
darkOliveGreen
darkOrange
darkOrchid
darkRed
darkSalmon
darkSeaGreen
darkSlateBlue
darkSlateGray
darkTurquoise
darkViolet
deepPink
deepSkyBlue
dimGray
dodgerBlue
火砖色
花白
forestGreen
紫红色
亮灰色
ghostWhite

金色
金麒麟色
灰色
green
greenYellow
蜜色
hotPink
indianRed
靛蓝色
乳白色
卡其色
淡紫色
lavenderBlush
lawnGreen
lemonChiffon
lightBlue
lightCoral
lightCyan
lightGoldenrodYellow
lightGray
lightGreen
lightPink
lightSalmon
lightSeaGreen

lightSkyBlue
lightSlateGray
lightSteelBlue
lightYellow
lime
limeGreen
亚麻色
洋红色
褐红色
mediumAquamarine
mediumBlue
mediumOrchid
mediumPurple
mediumSeaGreen
mediumSlateBlue
mediumSpringGreen
mediumTurquoise
mediumVioletRed
midnightBlue
mintCream
mistyRose
鹿皮色
navajoWhite

深蓝色
oldLace
橄榄色
oliveDrab
orange
orangeRed
兰花紫
paleGoldenrod
paleGreen
paleTurquoise
paleVioletRed
木瓜Whip
peachPuff
秘鲁棕色
pink
梅红色
powderBlue
purple
红色
rosyBrown
royalBlue
saddleBrown
鲑肉色

sandyBrown
seaGreen
贝壳
赭色
银色
skyBlue
slateBlue
slateGray
snow
springGreen
steelBlue
tan
水鸭色
蓟色
番茄色
transparent
宝石绿色
紫罗兰色
小麦色
white
whiteSmoke
yellow
yellowGreen

示例

以下示例取自 SDK 示例的包清单。

<Applications>
    <Application Id="App" StartPage="default.html">
        <uap:VisualElements 
            DisplayName="ApplicationDataSample"
            Description="Application data sample"
            BackgroundColor="#FFFFFF"               
            Square150x150Logo="images\squareTile-sdk.png" 
            Square44x44Logo="images\smallTile-sdk.png" 
            AppListEntry="default">
            <uap:DefaultTile
                ShowName="allLogos" />
            <uap:LockScreen
                Notification="badge"
                BadgeLogo="images\badgeLogo.png" />
            <uap:SplashScreen
                BackgroundColor="white"
                Image="images\splash-sdk.png" />
            <uap:InitialRotationPreference> 
                <uap:Rotation
                    Preference="portrait" />
            </uap:InitialRotationPreference>            
        </uap:VisualElements>
    </Application>
</Applications>                             

另请参阅

要求

Namespace http://schemas.microsoft.com/appx/manifest/uap/windows10
Minimum OS Version Windows 10版本 1511 (内部版本 10586)