MAUI如何删除标题栏并修复窗口尺寸?
如何在应用程序版本的Windows版本中删除MAUI中的标题栏并将窗口大小固定为800x400像素?
我在Internet中搜索了很长时间毛伊岛后来的版本一年多以前发布。为什么Maui不支持窗口调整大小并将其缩放为条件WPF,它也将XAML用于窗口创建,我希望该版本有可能。
标题栏看起来很折断,因为它比关闭/倒塌/最大化按钮高。
How can I remove the Title Bar in MAUI and fix the window size as 800x400 pixels in the Windows version of the application?
I searched for a very long time in the Internet, but I found already not actual information for later versions of MAUI released more than a year ago. Why MAUI does not support window resizing and disabling its scaling as conditional WPF, it also uses XAML for window creation, I wish there was such a possibility on the release.
The Title Bar looks broken because it is taller than the close/collapse/maximize buttons.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
不是在外壳本身中,而是在页面中显示在shell 内的页面,您应该设置
shell.navbarisvisible
属性为false,例如:Not in the shell itself, but in the page that's being displayed inside the shell, you should set the
Shell.NavBarIsVisible
attribute to false, like so:当标题为空的时候,没有显示上层栏。像这样:
这样:
如果您使用shell可以使用shell.navbarisvisible =“ false”。
When do title is empty then no show upper bar. Like this:
Like this:
if you use shell you can use Shell.NavBarIsVisible="False".
您可以读取文档 setBorderandtitlebar 和
您的mauiprogram.cs应该看起来像这样,
但是您需要的代码是预处理器指令中发现的代码
You can read the documentation SetBorderAndTitleBar and Resize:
Your MauiProgram.cs should look like this
But the code you need specifically is the one found in the preprocessor directive
这是一个已知的错误和a pr是开放的现在,当合并时,它将将被固定。
This a known bug and a PR is open for it right now, when merged it will be fixed.
也许这会比仅仅显示部分代码和令人困惑的情况更清晰,尤其是新手。记下“Shell.NavBarIsVisible”。
Maybe this will make it much clearer than just showing portions of the codes and confusing, especially newbies. Take note of the "Shell.NavBarIsVisible".
如果您希望您的应用程序完整屏幕(完全)隐藏的titlebar:
Your MauiProgram.cs file should look like this if you want your app to be fullscreen with (completely) hidden titlebar:
我正在使用.NET MAUI和模态导航,我想拥有一个全屏应用程序 - 没有标题标题 - 无框架此代码对我有用。
I am using .NET MAUI and MODAL navigation and I wanted to have a full-screen app - without header title - without any frame this code worked for me.
我在屏幕顶部也有顶部蓝色栏,因此位于工具栏上方。
这是我转换应用程序时的情况 Xamarin =>毛伊岛。
Xamarin:我有 MainActivity 主题 = "@style/Maui.SplashTheme"
并且没有顶栏。
毛伊岛:它是主题 =“@style/MainTheme”
并出现顶栏。
因此,在 Maui 应用程序中,我将主题替换为与 Xamarin 应用程序中相同的主题。
因此,在 [Maui Android] 应用程序 MainActivity.cs 中,我将主题设置为
主题=“@style/Maui.SplashTheme”
现在不再有顶部蓝色条。
希望这能有所帮助。
I also have the Top blue bar at top of screen and hence above the toolbar.
This when I converted an application Xamarin => Maui.
Xamarin : I have in MainActivity Theme = "@style/Maui.SplashTheme"
and NO top bar.
Maui : it is Theme = "@style/MainTheme"
and top bar appears.
Hence in Maui application I replace theme with the same as it is in Xamarin app.
Hence in [Maui Android] application MainActivity.cs I set the theme as
Theme = "@style/Maui.SplashTheme"
And now No more top blue bar.
Hope this can help.