uap3:VisualElements (Windows 10)

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

元素层次结构

<包>

      <应用程序>

            <应用程序>

                  <uap3:VisualElements>

语法

<uap3:VisualElements
    DisplayName = 'A string with a value between 1 and 256 characters in length. This string is localizable.' 
    Description = 'A string between 1 and 2048 characters in length.'
    BackgroundColor = 'A three-byte hexadecimal number preceded by "#" or a named color. See Remarks for a list of named colors.'
    Square150x150Logo = 'A string with a value 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 with a value 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".' 
    VisualGroup = 'A string with a value between 1 and 256 characters in length that does not contain backslashes ("\").' />

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

</uap3:VisualElements>

密钥

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

特性和元素

属性

属性 说明 数据类型 必须 默认值
DisplayName 可向用户显示的应用的友好名称。 此字符串可本地化;有关详细信息,请参阅备注。 值长度介于 1 到 256 个字符之间的字符串。 此字符串可本地化。
说明 应用的说明。 此字符串可本地化;有关详细信息 ,请参阅备注 长度介于 1 到 2048 个字符之间的字符串。
BackgroundColor 指定应用磁贴的背景色。 一个三字节十六进制数字,前面有 # 命名颜色或命名颜色。 有关命名颜色的列表,请参阅 备注
Square150x150Logo 用作应用的“开始屏幕”媒体磁贴和任务切换器上的图像。 有关如何在此属性中指定图像的详细信息,请参阅 备注 值长度介于 1 到 256 个字符之间的字符串,以 、 或 结尾,不能包含以下字符:<>:"|?、 或 *.jpg.jpeg.png 在此字符串中, /\ 字符不能是第一个或最后一个字符。 此外,字符串可以包含 或,\但不能同时包含/两者。
Square44x44Logo 用作应用的“开始屏幕”小磁贴和“所有应用列表”上的图像。 有关如何在此属性中指定图像的详细信息,请参阅 备注 值长度介于 1 到 256 个字符之间的字符串,以 、 或 结尾,不能包含以下字符:<>:"|?、 或 *.jpg.jpeg.png 在此字符串中, /\ 字符不能是第一个或最后一个字符。 此外,字符串可以包含 或,\但不能同时包含/两者。
AppListEntry “所有应用列表”中的条目。 可具有以下值之一的可选字符串: defaultnone
VisualGroup 要在“所有应用列表”上创建的文件夹的名称,其中应存储应用的磁贴。 一个字符串,其值长度介于 1 到 256 个字符之间,不包含反斜杠 (\) 。

注意

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

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

子元素

子元素 说明
uap:DefaultTile 定义表示“开始”屏幕上应用的默认磁贴。 首次安装应用时,在收到任何更新通知之前,会显示此磁贴。 当磁贴没有要显示的通知时,磁贴将还原到此默认值。
uap:LockScreen 定义锁屏界面上表示应用的锁屏提醒和通知,锁屏界面在系统锁定时显示。
uap:SplashScreen 定义初始屏幕的外观,初始屏幕在启动期间由应用显示。
uap:InitialRotationPreference 描述应用为了获得最佳用户体验而希望显示的方向。

父元素

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

注解

不能使用 VisualGroup 属性创建嵌套文件夹的结构。 如果在值中包含反斜杠 (\) ,则会发生错误。

如果清单仅声明一个应用, 则 VisualGroup 属性无效。

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

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

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

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
古色白
浅绿色
水绿色
azure
米黄色
橘黄色
black
blanchedAlmond
blue
blueViolet
棕色
burlyWood
cadetBlue
黄绿色
巧克力色
珊瑚色
玉米花蓝色
玉米丝色
深红色
蓝绿色
深蓝色
深色青色
darkGoldenrod

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

金色
金麒麟色
灰色
green
greenYellow
蜜色
hotPink
indianRed
靛蓝色
乳白色
卡其色
淡紫色
草布卢什
草坪绿色
lemonChiffon
浅蓝色
lightCoral
浅青色
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

示例

以下示例在“所有应用列表”中创建名为 App1 的文件夹,并将 App1 的磁贴存储在该文件夹中。

<Package
    xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"  
    IgnorableNamespaces="... desktop">
    <Applications>
        <Application>
            <uap3:VisualElements
                DisplayName="App1" 
                Square150x150Logo="images/150x150.png" 
                Square44x44Logo="images/44x44.png" 
                Description="App1" 
                BackgroundColor="#777777" 
                AppListEntry="default" 
                VisualGroup="App1">  
                <uap:SplashScreen
                    BackgroundColor="#777777" 
                    Image="images/splash.png"/>  
           </uap3:VisualElements>  
        </Application>
    </Applications>
</Package>

要求

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