Insert Separator Line under NavigationBar in Android #21724
-
Beta Was this translation helpful? Give feedback.
Answered by
AlleSchonWeg
Apr 10, 2024
Replies: 1 comment
-
My trick is to set a BarBackground with a LinearGradientBrush: <Style TargetType="NavigationPage"
ApplyToDerivedTypes="True">
<Setter Property="BarBackground">
<OnPlatform x:TypeArguments="Brush">
<On Platform="Android">
<LinearGradientBrush StartPoint="0,0"
EndPoint="0,1">
<GradientStop Color="{AppThemeBinding Light={StaticResource BackgroundColor}, Dark={StaticResource BackgroundColor-dark}}"
Offset="0.0" />
<GradientStop Color="{AppThemeBinding Light={StaticResource BackgroundColor}, Dark={StaticResource BackgroundColor-dark}}"
Offset="0.99" />
<GradientStop Color="{AppThemeBinding Light={StaticResource SeparatorColor}, Dark={StaticResource SeparatorColor-dark}}"
Offset="0.99" />
<GradientStop Color="{AppThemeBinding Light={StaticResource SeparatorColor}, Dark={StaticResource SeparatorColor-dark}}"
Offset="1.0" />
</LinearGradientBrush>
</On>
<On Platform="iOS">
<SolidColorBrush Color="{AppThemeBinding Light={StaticResource BackgroundColor}, Dark={StaticResource BackgroundColor-dark}}" />
</On>
</OnPlatform>
</Setter>
<Setter Property="BarTextColor"
Value="{AppThemeBinding Light={StaticResource BaseTextColor}, Dark={StaticResource BaseTextColor-dark}}" />
</Style> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
AlleSchonWeg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My trick is to set a BarBackground with a LinearGradientBrush: