MAUI. How to remove the Title Bar?
I need to remove the top panel so that the user can not use the buttons on it.
87 Replies
are u reffering to the black bar or the minimize, close etc buttons
in general, this whole area, because if you then switch to another page, the "back" button will appear.
well that black menu is from the debug tools they wont show up of the user and u can minimize it by clicking the arrow
as for the navigation
try Shell.NavBarIsVisible="False"
but if u want to make it completely borderless like in WPF I am unsure if that is currently possible with MAUI
I tried to add this line to my view, but nothing disappeared.
u would do that to the shell
well depends how ur app is structured
but the main window
how about disabling the flyout?
Shell.FlyoutBehavior="Disabled"
insert instead of "navbar"?
u can have both
neither one nor the other works(
I cannot see the back button in your image thou so it makes hard for me to identify if these are what u really want
1 minute
u might want to try this one to false ExtendsContentIntoTitleBar
ah ok yeah I think u want the above then
well, I'll find out, maybe if nothing terrible happens, then you can leave it, it will just look strange on some pages
ExtendsContentIntoTitleBar would remove it from the title bar
if u set it to false
how?
im finishing update my vs if u give me a few minutes I will check it out and explain
ok
but it should work if u throw it inside the constructor under InitializeComponent();
just
I can't figure out which library it belongs to
yeah give me a few and I will let u know had a bad day with vs
)
@plushechka in the MauiProgram.cs
using FitLogDiplom.IViews;
using FitLogDiplom.Models;
using FitLogDiplom.Services;
using FitLogDiplom.Views.Mobile;
using FitLogDiplom.Views.Desktop;
using Microsoft.Extensions.Logging;
using FitLogDiplom.ViewModels;
using FFImageLoading.Maui;
namespace FitLogDiplom
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseFFImageLoading()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
})
.UseViewServices();
builder.Services.AddDbContext<FitLogDiplomContext>();
builder.Services.AddSingleton<SignInViewModel>();
#if ANDROID || IOS
builder.Services.AddSingleton<ISignInView, MobileSignInView>();
builder.Services.AddTransient<IRegistrationView, MobileRegistrationView>();
#else
builder.Services.AddSingleton<ISignInView, DesktopSignInView>();
builder.Services.AddTransient<IRegistrationView, DesktopRegistrationView>();
#endif
return builder.Build();
}
}
}
u would add
Did it work for you?
yes
there are more things u can remove give me a moment
so yeah u can remove the hwole thing
without that, this is what it looks like
I don't quite understand where to implement this
looks right
is it not compiling?
yes
which libraries should I use?
ah right mmm
these 2
True, it worked, but now you can't pull the window and change its size, it's a constant value. Also, then you can make the main three buttons to hide, close and minimize
do I understand correctly that this only works for Windows?
I dont know if thye work for mac as I never tried
u would have to try
essentially yes
these remove those buttons
android dont support this
This removes the border and title
This only prevents the controls from invading the title bar
mobile works different
so the navigation is completely different from what u have on windows
on mobile u dont have a border title and button per say
but you asked this for windows anyway right?
having such an empty area and removing all the buttons, etc., can I add my own buttons or text there, for example?
for android too, but not scary, I think)
well the window u showed me doesn't exist on android
its different as I said
which would be disabled by those 2 properties I gave u earlier
and now can I add my own elements to this panel, thereby not leaving this empty white space?
u should be able to yes
or reduce its size to a minimum
i saw what mine looks like?
there
can you give a github or tell me how to do it?
what I am using here is just the sample maui app
GitHub
GitHub - dotnet/maui-samples: Samples for .NET Multi-Platform App U...
Samples for .NET Multi-Platform App UI (.NET MAUI) - dotnet/maui-samples
more specifically this one https://github.com/dotnet/maui-samples/tree/main/8.0/Apps/WeatherTwentyOne
GitHub
maui-samples/8.0/Apps/WeatherTwentyOne at main · dotnet/maui-samples
Samples for .NET Multi-Platform App UI (.NET MAUI) - dotnet/maui-samples
ok, thank you
@leowest I apologize, but have you tried changing the color of this panel?
which panel?
this
never tried but I think I saw some properties to do it
Shell.BackgroundColor="#080927" i tried it
perfectly
in the content page Shell.BackgroundColor="DarkGreen"
should work for that
who the hell knows
if nothing went green in yours then something to do with your xaml
it's a heck of a thing, I even removed the MauiProgram stuff I previously put in with you. It still won't change to green
do u have a github of your project I can try?
I'll fix some things and get them to you.
GitHub
GitHub - 5LU6E4KA/FitLogDiplom
Contribute to 5LU6E4KA/FitLogDiplom development by creating an account on GitHub.
@leowest if anything, I'll comment on where and what.
I will take a look in a few and get back to u a bit busy right now
ok
DesktopSignInView.xaml
i try
How?
the XAML above
u can literally replace the one u have in the file DesktopSignInView.xaml
and it should give u the same thing
NavigationPage.HasNavigationBar="False"
is what removes teh white space at the top and lets u use the full space
Shell.BackgroundColor="Green" Why didn't it work?
u dont need it
the way your page is working
u can modify the grid directly
and it will affect the space
<Grid BackgroundColor="DarkBlue" Grid.ColumnSpan="5"/>
that is the first row
and I changed its color to dark blue
is doing the same thing in the next view a workable option?
yes
supposedly, now I can add close buttons and other buttons there too?
dunno u can try
Do you know if the same option will work for the mobile version?
again mobile is different
the menu u have for desktop does not work in mobile
so u will have to learn the mobile way of doing things
mobile also does no have a minimize, close button
like u have in a normal desktop app
so u will have to learn those and adjust as needed
@leowest Ok, if anything, can I contact you in private messages for questions?, I'm just a beginner).
sorry I dont take dms. you can open another #help and whoever is available at the time will help you out, there are others around that can help as well 🙂
once u start doing android etc u will understand better what I am saying
ok, thank you so much for your help today.
no worries 😉
Use the /close command to mark a forum thread as answered