Creating and using PlatformEffects in your app
In this section, we will see how we can work with the PlatformEffects
API, which will allow us to customize the appearance and styling of our Xamarin.Forms
native control elements for both the iOS and Android platforms. You will notice that these implementations have the same class names, but will be implemented completely differently, as you will see once we start.
We will look at how to create two completely different platform-effects, ButtonShadowEffect
and LabelShadowEffect
, for both iOS and Android platforms.
Creating and Implementing the ButtonShadowEffect (iOS)
In this section, we will begin creating the ButtonShadowEffect
class for the iOS section of our TrackMyWalks
solution, which will essentially contain platform-specific methods that will be used by our ButtonShadowEffect
class. The advantage of creating a ButtonShadowEffect
class is that it's much easier to modify or add additional control properties that will be used by the XAML pages...