Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Background of ToastNotification

I want to know that how we can change the background color for the toast notification in Windows Metro (or Desktop) app.

Thanks in advance.

like image 513
user1530727 Avatar asked Aug 08 '12 07:08

user1530727


People also ask

How do you change the color of a toaster?

If you need to change the background of the Toast then you need to use getView(). setBackground() function. If You need to change the color of the view created then you need to use getView(). getBackground().

How do you change the background color on Toastify?

The easiest solution to adjust the BG of Toastify, or in fact any styles would be to use the ToastContainer props toastStyle: which takes in JSX attributes. After importing the necessary packages , while adding the ToastContainer component , just pass in the toastStyle prop and you shall be good to go.

Which template is recommended for create adaptive toast notifications?

In our sample, I have used the ToastGeneric template, as this defines the Toast Notification as Adaptive. The below code helps in doing it. text elements are used to display the text in the toast, if the user needs to add image in the toast then he can display it by adding the image element.


2 Answers

Foreground: You can set "Foreground text" in you app manifest to dark or light.

Background: This follows the "Background color" of the app manifest - and hence will be the same as the app's tile background.

For most of the apps I've worked on, it's enough to set the tile color according the UI spec - and then set the 'foreground text' to light or dark. You can surely override the light/dark themes if you want to too.

like image 126
andyhammar Avatar answered Sep 27 '22 23:09

andyhammar


For desktop apps, the background color used on toast notifications (and Start screen tiles) is not configurable by the app itself. The color for the tiles is determined by the Start screen color theme chosen by the user (PC Settings -> Personalize -> Start screen), and the color of the background of toast notifications is always gray (when not in a high-contrast theme).

like image 35
Nathan Kuchta Avatar answered Sep 27 '22 23:09

Nathan Kuchta