Share via


適用于 Windows 8.1) 的 v s (擴充功能架構

描述 UWP 應用程式的視覺層面:其預設磚、標誌影像、文字和背景色彩、初始螢幕方向、啟動顯示畫面,以及鎖定畫面磚外觀。

元素階層

<VisualElements>

語法

<VisualElements DisplayName     = A string between 1 and 256 characters in length. This string is localizable. 
                Description     = A string between 1 and 2048 characters in length that cannot include characters such as tabs, carriage returns, and line feeds.
                ForegroundText  = "light" | "dark"
                BackgroundColor = A three-byte hexadecimal number preceded by "#" or a named color.
                ToastCapable?   = boolean
                Logo            = A string between 1 and 256 characters in length that ends with ".jpg", ".png", or ".jpeg" that can't contain these characters: <, >, :, ", |, ?, or *. In this string, the / and \ characters can't be the first or last characters. Also, the string can contain / or \ but not both.
                SmallLogo       = A string between 1 and 256 characters in length that ends with ".jpg", ".png", or ".jpeg" that can't contain these characters: <, >, :, ", |, ?, or *. In this string, the / and \ characters can't be the first or last characters. Also, the string can contain / or \ but not both. >

  <!-- Child elements -->
  ( DefaultTile?
  & LockScreen?
  & SplashScreen
  & InitialRotationPreference?
  )

</VisualElements>

答案

? 選擇性 (零或一)

& 交錯連接器 (可能會以任何順序發生)

屬性和項目

屬性

屬性 描述 資料類型 必要 預設值
BackgroundColor

指定應用程式磚的背景色彩。 請參閱 [備註] 區段中的色彩名稱。 請注意,此處指定的背景色彩也適用于下列專案:

  • 任何應用程式所擁有之對話方塊中的按鈕色彩
  • Microsoft Store 中的應用程式描述頁面

適用于 Windows Phone:選擇「透明」會導致使用系統輔色。

三位元組的十六進位數位,前面加上 "#" 或命名色彩。
說明

應用程式的描述。 這個字串可以當地語系化;如需詳細資訊,請參閱備註。

長度介於1到2048個字元之間,且不能包含定位字元、換行字元和換行字元的字串。 Yes
DisplayName

可向使用者顯示的應用程式易記名稱。 這個字串可以當地語系化;如需詳細資訊,請參閱備註。

有兩個明確的保留字可能無法作為上傳至 Microsoft Store 之應用程式的 DisplayName: "NoUIEntryPoints" 和 "NoUIEntryPoints DesignMode"。 這些識別項是保留給開發工具和測試套件使用。

長度介於1到256個字元之間的字串。 這個字串可當地語系化。 Yes
ForegroundText

指定應用程式磚的前景色彩。

適用于 Windows Phone:選擇「透明」會導致使用系統輔色。

這個屬性可以具有下列其中一個值:

  • 光線
  • 黑暗
Yes
標誌

用來作為應用程式正方形磚的影像。 如需如何在這個屬性中指定影像的詳細資訊,請參閱備註。

長度介於1到256個字元之間的字串,以 ".jpg"、".png" 或 ". jpeg" 結尾,且不能包含下列字元: < 、 > 、:、"、|、?或 *。 在此字串中,/和字元不能是第一個或最後一個字元。 此外,此字串可以包含/或 \,但不能同時包含兩者。 Yes
SmallLogo

圖格角落顯示的小型影像,用來識別應用程式。 如需如何在這個屬性中指定影像的詳細資訊,請參閱備註。

適用于 Windows Phone: Windows Phone 不支援磚上的小標誌。 它只會在應用程式清單中使用。

長度介於1到256個字元之間的字串,以 ".jpg"、".png" 或 ". jpeg" 結尾,且不能包含下列字元: < 、 > 、:、"、|、?或 *。 在此字串中,/和字元不能是第一個或最後一個字元。 此外,此字串可以包含/或 \,但不能同時包含兩者。 Yes
ToastCapable

True值表示允許應用程式提供快顯通知。 預設值為 false。 如果您不想要顯示快顯通知,請勿指定此屬性的值。 請注意,應用程式不應該根據此值來決定是否要傳送快顯通知。

boolean No

 

子元素

子元素 描述
DefaultTile

預設圖格代表開始畫面上的應用程式。 第一次安裝應用程式時,會在應用程式收到任何更新通知之前顯示此磚。 當磚沒有任何要顯示的通知時,磚會還原為此預設值。

InitialRotationPreference

描述應用程式偏好顯示的方向,以獲得最佳使用者體驗。 在可以旋轉的裝置上(例如平板電腦),將不會針對此處未指定的方向重新繪製應用程式。 例如,如果應用程式只指定橫向和 LandscapeFlipped 方向,而裝置旋轉為直向,應用程式將不會旋轉。

請注意,在無法旋轉的裝置上,應用程式可能會以該裝置的預設方向顯示,而應用程式的慣用方向將會被忽略。 不過,在啟用旋轉鎖定的裝置上,仍會接受您應用程式的慣用旋轉。

當您的應用程式啟動新的會話時,這些方向喜好設定選項同時適用于 [啟動顯示畫面] (element-splashscreen.md) 和應用程式 UI。 在執行時間,您可以透過 [displayproperties.autorotationpreferences] (/uwp/api/Windows 來變更喜好設定。DisplayInformation) 屬性。

LockScreen

定義徽章和通知,表示鎖定畫面上的應用程式,這會在系統鎖定時顯示。

SplashScreen

定義啟動顯示時,應用程式所顯示的啟動顯示畫面的外觀。

 

父項目

這個最外層的 (檔) 元素可能不會包含在任何其他專案中。

備註

如需磚維度需求的詳細資訊,請參閱 圖格大小

標誌SmallLogo 影像可指定為影像檔案的直接路徑,或做為資源。 藉由使用資源參考,您可以提供不同縮放比例的影像,讓 Windows 可以為裝置和螢幕解析度選擇最佳大小。 您也可以提供協助工具的高對比影像和當地語系化的影像,以符合不同的 UI 語言。 這項功能也可讓您當地語系化 DisplayNameDescription 屬性。 如需詳細資訊,請參閱 全球化 主題。

應用程式/應用程式/延伸模組/延伸模組/FileTypeAssociation/標誌應用程式/應用程式/延伸模組/擴充/通訊協定/標誌

這兩種類型的標誌影像大小需求如下所示:

影像屬性縮放影像大小(圖元) Applications\Application\VisualElements\ @Logo 100 150x150 140 210x210 180 270x270 Applications\Application\VisualElements\ @SmallLogo 100 30x30 140 42x42 180 54x54

以下是支援的背景色彩名稱:

名稱 名稱 名稱 名稱 名稱 名稱
aliceBlue antiqueWhite 青色 青綠色 azure 米黃色
淡黃色 黑色 blanchedAlmond 藍色 藍紫 棕色
burlyWood cadetBlue 淡黃綠 巧克力色 珊瑚紅 [Cornflowerblue
玉米穗黃 大紅色 青色 darkBlue darkCyan darkGoldenrod
暗灰色 darkGreen darkKhaki darkMagenta darkOliveGreen darkOrange
darkOrchid darkRed darkSalmon darkSeaGreen >darkslateblue darkSlateGray
darkTurquoise darkViolet deepPink deepSkyBlue dimGray dodgerBlue
磚紅 floralWhite forestGreen 桃紅 亮灰 ghostWhite
金色 金黃 灰色 綠色 >greenyellow 蜜瓜白
hotPink indianRed 靛藍 象牙白 卡其色 淡紫
lavenderBlush lawnGreen lemonChiffon lightBlue lightCoral lightCyan
lightGoldenrodYellow lightGreen lightGray lightPink lightSalmon lightSeaGreen
lightSkyBlue lightSlateGray lightSteelBlue lightYellow 淺綠色 暗綠
亞麻黃 洋紅 暗紅色 mediumAquamarine mediumBlue mediumOrchid
mediumPurple mediumSeaGreen mediumSlateBlue mediumSpringGreen mediumTurquoise mediumVioletRed
midnightBlue mintCream mistyRose 鹿皮黃 navajoWhite 海軍藍
oldLace 橄欖色 oliveDrab 橙色 orangeRed 蘭花紫
paleGoldenrod paleGreen paleTurquoise paleVioletRed papayaWhip peachPuff
秘魯色 粉紅色 梅紅色 powderBlue 紫色 紅色
rosyBrown royalBlue saddleBrown 淡橙紅 sandyBrown seaGreen
貝殼 深黃褐 銀色 skyBlue slateBlue 青灰
snow springGreen steelBlue tan 藍綠色 薊紫
蕃茄紅 透明 淺粉藍 紫色 小麥色 白色
白霧色 黃色 黃綠

 

範例

下列範例取自 SDK 範例的套件資訊清單。

                    
<Applications>
    <Application Id="App" StartPage="default.html">
        <VisualElements 
            DisplayName="ApplicationDataSample" 
            Logo="images\squareTile-sdk.png" 
            SmallLogo="images\smallTile-sdk.png" 
            Description="Application data sample" 
            ForegroundText="dark" 
            BackgroundColor="#FFFFFF" 
            ToastCapable="false">
            <DefaultTile ShowName="allLogos"/>
            <SplashScreen BackgroundColor="white" Image="images\splash-sdk.png"/>
        </VisualElements>
    </Application>
</Applications>
                

另請參閱

App 螢幕擷取畫面與影像

色彩類別

快速入門:使用 Visual Studio 資訊清單編輯器建立預設磚

需求

Namespace http://schemas.microsoft.com/appx/2010/manifest