Jason Yarrington
Jason Yarrington

Reputation: 71

How do you create a drop shadow in Xamarin Forms

How do you create a drop shadow on a button or label using Xamarin Forms. I am currently using Xamarin Forms 1.3 and trying to do this in XAML if possible. Does anyone have a working example they can point me to.

Upvotes: 3

Views: 9680

Answers (1)

Dean Chalk
Dean Chalk

Reputation: 20461

I have not tried this but you could create 2 instances of the same control and put them both inside a grid so that they lay directly over each other. Then with the first control (underneath) change the opacity to 0.2 so that it is very faint, then give it a small top and left margin so it sits slightly offset from the version above it. This should result in a drop-shadow type of effect. A much better (but more involved) way of doing this is to subclass the controls you want to add the effect to and then create custom renderers to add the effect for each platform using native code

Upvotes: 6

Related Questions