Reputation: 453
I have a Border element that contains a VerticalStackLayout which contains a bunch of controls.
I've applied a shadow to the border element; however, it is being applied to every Entry field inside of the border (other controls such as Label do not seem to be affected)
Just wondering how to turn this behavior off so that controls do not inherit from their parent?
Regards
Upvotes: 0
Views: 133
Reputation: 9244
After my testing, setting Shadow
for Border
will not affect the components in VerticalStackLayout
, including entry. You can refer to my test code to adjust your code structure:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Apr191102.MainPage">
<ScrollView>
<Border Stroke="#C49B33"
StrokeThickness="3"
StrokeShape="RoundRectangle 40,0,0,40"
Padding="16,8"
HorizontalOptions="Center">
<Border.Shadow>
<Shadow Brush="Black"
Offset="-10,-10"
Radius="10"
Opacity="0.9"></Shadow>
</Border.Shadow>
<VerticalStackLayout
Spacing="25"
Padding="30,0"
VerticalOptions="Center">
<Entry Text="dsadasdas" FontSize="Large"/>
<Label
Text="Hello, World!"
SemanticProperties.HeadingLevel="Level1"
FontSize="32"
HorizontalOptions="Center" />
</VerticalStackLayout>
</Border>
</ScrollView>
</ContentPage>
If you still encounter problems, you can add the relevant code of your project.
Upvotes: 0