Toast [1]
PUBLISHED
Toast is a common component and provides simple messages.
Unlike other popups, a toast consists only of a body field as it is just used for providing simple feedback to the user’s actions.
You can use a toast to provide simple messages when the user does not need to make an additional action or confirmation. A toast will automatically disappear after a certain time.
Create with Property
To create a toast using property, follow these steps:
-
Create toast using the default constructor:
utilityBasicToast = new Toast();
-
Set the toast property:
NPatchVisual nvisual = new NPatchVisual(); nvisual.URL = "Poptoast_background.png"; nvisual.Border = new Rectangle(64, 64, 4, 4); utilityBasicToast.Position = new Position(50, 350); utilityBasicToast.Size = new Size(512, 132); utilityBasicToast.TextArray = new string[1] { "null parameter" }; utilityBasicToast.PointSize = 26; utilityBasicToast.TextColor = Color.White; utilityBasicToast.TextPadding = new Extents(96, 96, 38, 38); utilityBasicToast.Duration = 1500; root.Add(utilityBasicToast);
Following output is generated when the toast is created using property: