Monday, 31 October 2016

Creating a Toast equivalent in Xamarin iOS

I love Android's toast - the UI widget that allows us to tell the user something. It's simple and accessible, and something iOS lacks unless you find a plugin of some sort.

I've started a new app build recently, using Xamarin with native Android and iOS interfaces, and it was with great joy today that I found a Xamarin toast component for iOS.

Really simple to use with a using ToastIOS statement, and then the following kind of call:
Toast.MakeText("Toast!", Toast.LENGTH_LONG)
.SetFontSize(10)
.SetGravity(ToastGravity.Center)
.Show(ToastType.None);