Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Removing shadow from android buttons

$
0
0

suddenly my buttons started showing shadows, which they didn't before. I am not sure what caused the style to change, but I would like to just have a plain rectangle with no visual effects as buttons.

i have already tried:
forums.xamarin.com/discussion/97653/button-without-shadow
alexdunn.org/2017/05/04/xamarin-tips-overriding-android-button-shadowselevation/
i.e.:

  • Creating a custom renderer that sets the Elevation property to 0 and/or sets StateListAnimator = null.
  • Setting a buttonStyle in styles.xml:
    <style name="NoShadowButton" parent="android:style/Widget.Button"> <item name="android:stateListAnimator">@null</item> </style>
    or using Base.Widget.AppCompat.Button.Borderless

but nothing is working.

I am also not looking for 'just use TapGestureRecognizers', i'd like to use buttons, this shouldn't be such a hard problem to solve.
Anyone have any tips?

tested on android 5.0.1, xamarin.forms 2.5.0.280555


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>