Skip to content

Commit 3b2c3dd

Browse files
authored
[Shell][iOS] You can now control navigation bar separator by using Shell.NavBarHasShadow. (#650)
1 parent 32c3fb0 commit 3b2c3dd

File tree

6 files changed

+15
-6
lines changed

6 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [47.3.0]
2+
- [Shell][iOS] You can now control navigation bar separator by using `Shell.NavBarHasShadow`.
3+
14
## [47.2.0]
25
- [NavigationListItem] Removed default icon color and set chevron color.
36
- [TabBar] Set different background color.

src/app/Components/ComponentsSamples/Alerting/AlertingSamples.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
<dui:NavigationListItem Title="{x:Static localizedStrings:LocalizedStrings.SystemMessage}"
1616
Command="{helpers:NavigationCommand {x:Type systemMessages:SystemMessageSamples}}"
17-
HasTopDivider="True"
1817
HasBottomDivider="True"/>
1918

2019
<dui:NavigationListItem Title="{x:Static localizedStrings:LocalizedStrings.Dialog}"

src/app/Playground/VetleSamples/VetlePage.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
x:Name="This"
1212
HideSoftInputOnTapped="True"
1313
Title="Hello"
14+
1415
>
1516

1617

src/library/DIPS.Mobile.UI/Components/Shell/Android/ShellRenderer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ internal class BadgeShellBottomNavViewAppearanceTracker : ShellBottomNavViewAppe
3737
public BadgeShellBottomNavViewAppearanceTracker(IShellContext shellContext, ShellItem shellItem) : base(shellContext, shellItem)
3838
{
3939
}
40-
40+
4141
protected override void SetBackgroundColor(BottomNavigationView bottomView, Microsoft.Maui.Graphics.Color color)
4242
{
4343
base.SetBackgroundColor(bottomView, color);

src/library/DIPS.Mobile.UI/Components/Shell/Shell.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ public Shell()
3030
SetTabBarBackgroundColor(this, Colors.GetColor(ColorName.color_background_default));
3131
SetTabBarTitleColor(this, Colors.GetColor(ColorName.color_text_action));
3232
SetTabBarUnselectedColor(this, Colors.GetColor(ColorName.color_icon_subtle));
33-
33+
34+
#if __ANDROID__
3435
SetNavBarHasShadow(this, false);
36+
#elif __IOS__
37+
SetNavBarHasShadow(this, true);
38+
#endif
3539
}
3640

3741
private async void OnNavigated(object? sender, ShellNavigatedEventArgs e)

src/library/DIPS.Mobile.UI/Components/Shell/iOS/ShellRenderer.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ protected override IShellNavBarAppearanceTracker CreateNavBarAppearanceTracker()
3232

3333
public class NavBarAppearanceTracker : IShellNavBarAppearanceTracker
3434
{
35+
private bool m_nextPageHasShadow;
36+
3537
public void Dispose()
3638
{
3739

@@ -73,8 +75,8 @@ public void SetAppearance(UINavigationController controller, ShellAppearance app
7375
navigationBarAppearance.BackgroundColor = background.ToPlatform();
7476

7577
// Clear divider line
76-
// TODO: Only hide this if we can manage to hide it in modal pages as well.
77-
/*navigationBarAppearance.ShadowColor = UIColor.Clear;*/
78+
if(!m_nextPageHasShadow)
79+
navigationBarAppearance.ShadowColor = UIColor.Clear;
7880

7981
// Set TitleColor
8082
var titleColor = appearance.TitleColor;
@@ -96,7 +98,7 @@ public void UpdateLayout(UINavigationController controller)
9698

9799
public void SetHasShadow(UINavigationController controller, bool hasShadow)
98100
{
99-
101+
m_nextPageHasShadow = hasShadow;
100102
}
101103
}
102104

0 commit comments

Comments
 (0)