Change background color of the tile programatically?

一世执手 提交于 2019-12-12 04:31:55

问题


I understand the background is actually an image (WideLogo.png/SmallLogo.png) and specified in the app manifest file. But is it possible to swap these with a new set of images programatically? Based on the information displayed on the tile, I want to change the background color of the tile.


回答1:


You cannot edit the app manifest to change the default color. However, you can render an image with the appropriate background color and content then set it as tile.

For more details on how to achieve that, read: Windows 8 Metro App - Render PNGs




回答2:


I don't think you can change the background color of the tile programmatically. That's set in the manifest for the default tile, so that you can overlay a transparent background image for a predictable default look for your tile.

But you can send tile notifications from your app while running, and these can include images and text.

Here's a link to the MSDN docs on tiles and notifications:

http://msdn.microsoft.com/en-us/library/windows/apps/hh779724.aspx

and to the catalog of tile templates you can use:

http://msdn.microsoft.com/en-us/library/windows/apps/hh761491.aspx

One way you could implement this is to programmatically create a tile image with the background color and text you want, and then send that as a tile notification.



来源:https://stackoverflow.com/questions/12786740/change-background-color-of-the-tile-programatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!