Share via

Disable title bars in MacOs

Eduardo Gomez 4,316 Reputation points
2026-02-10T20:29:59.1566667+00:00

I have this method

 static void MaximizeWindows() {

     if(Application.Current?.Windows is not { Count: > 0 } windows)
         return;

     if(windows[0].Handler?.PlatformView is not { } platformWindow)
         return;

     var hwnd = WindowNative.GetWindowHandle(platformWindow);
     var windowId = Win32Interop.GetWindowIdFromWindow(hwnd);

     if(AppWindow.GetFromWindowId(windowId).Presenter is OverlappedPresenter presenter) {
         presenter.Maximize();
         presenter.IsMaximizable = false;
         presenter.IsResizable = false;
         presenter.IsMinimizable = true;
     }
 }

and this will make this

User's image

but I need help to make this possible on mac

Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

Answer accepted by question author
  1. Nancy Vo (WICLOUD CORPORATION) 880 Reputation points Microsoft External Staff Moderator
    2026-02-11T06:14:38.18+00:00

    Hi @Eduardo Gomez ,

    Thanks for reaching out.

    For more details, you can refer to this article: UITitlebar

    While this is a non-Microsoft link, it’s official Apple Developer documentation and is safe to visit.

    From the code and the picture you show, you want to make possible on mac like this: hide title bar, lock size and start fullscreen. While the window code you shared already solves it on Windows, for macos you need to separate platform-specific implementation.

    You may refer to the code below:

    Note: run this after the MAUI window is created (for ex: in Window.Created or by overriding CreateWindow).

    MacWindowHelper.cs

    #if MACCATALYST
    using System;
    using System.Linq;
    using Foundation;
    using UIKit;
    
    public static class MacWindowHelper
    {
        public static void ConfigureMainWindow()
        {
            var scene = UIApplication.SharedApplication
                .ConnectedScenes
                .OfType<UIWindowScene>()
                .FirstOrDefault();
    
            if (scene is null)
                return;
    
            var window = scene.Windows.FirstOrDefault();
            if (window is null)
                return;
    
            if (scene.Titlebar is not null)
                scene.Titlebar.TitleVisibility = UITitlebarTitleVisibility.Hidden;
    
            scene.RequestGeometryUpdate(
                new UIWindowSceneGeometryPreferencesMac(UIMacOSWindowSize.FullScreen),
                error => { });
    
            NSTimer.CreateScheduledTimer(TimeSpan.FromMilliseconds(400), _ =>
            {
                var size = window.Bounds.Size;
                scene.SizeRestrictions.MinimumSize = size;
                scene.SizeRestrictions.MaximumSize = size;
            });
        }
    }
    #endif
    
    

    App.xaml.cs

    using Microsoft.Maui.Controls;
    
    public partial class App : Application
    {
        public App()
        {
            InitializeComponent();
        }
    
        protected override Window CreateWindow(IActivationState? activationState)
        {
            var window = base.CreateWindow(activationState);
    
    #if MACCATALYST
            window.Created += (_, __) => MacWindowHelper.ConfigureMainWindow();
    #endif
    
            return window;
        }
    }
    

    Note: if you just care about the hidden title bar, just care this:

    if (scene.Titlebar is not null)
        scene.Titlebar.TitleVisibility = UITitlebarTitleVisibility.Hidden;
    

    Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 83,581 Reputation points Volunteer Moderator
    2026-02-10T22:18:30.9133333+00:00

    to remove the title see:

    https://developer.apple.com/documentation/uikit/removing-the-title-bar-in-your-mac-app-built-with-mac-catalyst

    to make borderless see NSWindowStyleMaskBorderless. if you do this, by default it can not be the main window. if you want it be main then you have two add code.

    https://developer.apple.com/documentation/appkit/nswindow/stylemask-swift.struct/borderless?language=objc

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.