如何在 Windows 10 App 中设置 Toast Capable
How to set Toast Capable in Windows 10 App
我想知道如何在 UWP 应用程序中设置 toast 功能。我使用的是 Visual Studio 2015,在 Package.appxmanifest 编辑器中没有任何选项。我试着手动编辑 xml,msdn 说你可以像那样手动添加。
<VisualElements
...
ToastCapable="true">
</VisualElements>
但我发现 .appxmenifest 是那样的
<uap:VisualElements DisplayName="Name" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Sample" BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" ShortName="Name">
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
<uap:InitialRotationPreference>
<uap:Rotation Preference="portrait" />
<uap:Rotation Preference="landscape" />
<uap:Rotation Preference="portraitFlipped" />
<uap:Rotation Preference="landscapeFlipped" />
</uap:InitialRotationPreference>
</uap:VisualElements>
如何实现吐司功能?请帮忙。
在 Windows10 中,您不再需要设置 ToastCapable 标志:
Hmm, well you definitely need to have ToastCapable set to true in the
manifest since 8.1 required that, otherwise your toasts won’t work in
8.1 (in 10, we stopped requiring the ToastCapable flag).
来源:Comment on the official Quickstart guide
您可以在 GitHub 上的快速入门 full source code 中自行验证。
我想知道如何在 UWP 应用程序中设置 toast 功能。我使用的是 Visual Studio 2015,在 Package.appxmanifest 编辑器中没有任何选项。我试着手动编辑 xml,msdn 说你可以像那样手动添加。
<VisualElements
...
ToastCapable="true">
</VisualElements>
但我发现 .appxmenifest 是那样的
<uap:VisualElements DisplayName="Name" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Sample" BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" ShortName="Name">
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
<uap:InitialRotationPreference>
<uap:Rotation Preference="portrait" />
<uap:Rotation Preference="landscape" />
<uap:Rotation Preference="portraitFlipped" />
<uap:Rotation Preference="landscapeFlipped" />
</uap:InitialRotationPreference>
</uap:VisualElements>
如何实现吐司功能?请帮忙。
在 Windows10 中,您不再需要设置 ToastCapable 标志:
Hmm, well you definitely need to have ToastCapable set to true in the manifest since 8.1 required that, otherwise your toasts won’t work in 8.1 (in 10, we stopped requiring the ToastCapable flag).
来源:Comment on the official Quickstart guide
您可以在 GitHub 上的快速入门 full source code 中自行验证。