Open AlexeyZhukoff opened 2 years ago
This might be expected behaviour... If you set VerticalTextAlignment="Center"
on the label it shows centered as in the screenshot below...
@PureWeen thoughts?
@Redth so this isn't really a bug. It's just kind of a confusion based on the styling defaults. The TitleView gets placed inside the UINavigationBar on iOS and our default styles make it the same color as the background. So the underline you are seeing there is the shadow from the NavBar. You might be able to get rid of it by setting Shell.NavBarHasShadow
to false?
Yes, i try this, but horizontal line still visible
@samhouts Hello! Any update on this issue?
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Still seeing this after the .NET 7 release. Confirmed setting Shell.NavBarHasShadow
to false doesn't fix it.
This is still an issue
As a workaround: https://github.com/xamarin/Xamarin.Forms/issues/14938
Verified this issue with Visual Studio Enterprise 17.6.0 Preview 2.0. Repro on iOS simulator with sample project. Archive.zip
Is anyone looking into this or have a workaround at least? The separator is so ugly when trying to be an immersive app
Any news for this?
Possible workaround, this works for navigationbar itself, so hopefully also for TitleView.
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
// Remove 1px shadow beneath navigationbar
UINavigationBar.Appearance.ShadowImage = new UIImage();
return base.FinishedLaunching(application, launchOptions);
}
As a workaround for this, I copied the ShellNavBarAppearanceTracker class into a new custom one "CustomNavBarAppearanceTracker", and just added this code under both methods UpdateNavigationBarAppearance and UpdateiOS13NavigationBarAppearance:
navBar.ShadowImage = new UIImage();
Then created a new ShellRenderer under ios platform
public class CustomShellRenderer : ShellRenderer
{
protected override IShellNavBarAppearanceTracker CreateNavBarAppearanceTracker()
{
return new CustomNavBarAppearanceTracker();
}
}
Then in maui program under AddHandlers - I added
#if IOS
handlers.AddHandler(typeof(Shell), typeof(MyApp.Platforms.iOS.Renderers.CustomShellRenderer));
#endif
Description
Shell has underline under TitleView if BackGroundColor is setted
Steps to Reproduce
Version with bug
Release Candidate 2 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 15.4
Did you find any workaround?
no
Relevant log output
No response