I am having one stacklayout and one button inside that. I want to click through that stacklayout, and also that button click.
I tried setting InputTransparent as true for StackLayout and then setting same as false for button. It did not work. Whatever applied at parent level is set to all children inside it.
<StackLayout InputTransparent="True">
<Button Text="Submit" InputTransparent="False"/>
</StackLayout>
I expect button to be clicked, as well as element behind StackLayout should be clickable.
Layouts have a property CascadeInputTransparent. When true, child views inherit their parent's input transparency. When false, child views do not inherit the input transparency of the layout where Cascade is set.
https://learn.microsoft.com/en-us/dotnet/api/xamarin.forms.layout.cascadeinputtransparent?view=xamarin-forms
Use CascadeInputTransparent
.
<StackLayout InputTransparent="True" CascadeInputTransparent="False">
<Button Text="Submit"/>
</StackLayout>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With