简介
在WinUI3里可以通过PreferredHeightOption来设置标题栏的高度属性,这个选项不适用于Windows原生样式标题栏,仅限于使用ExtendsContentIntoTitleBar属性扩展的标题栏选项
使用方法
设置高度有三个属性:
Standard: 默认标题栏高度
this->ExtendsContentIntoTitleBar(true);
this->AppWindow().TitleBar().PreferredHeightOption(
Microsoft::UI::Windowing::TitleBarHeightOption::Collapsed);

Tall: 标题栏变高、按钮更大
this->ExtendsContentIntoTitleBar(true);
this->AppWindow().TitleBar().PreferredHeightOption(
Microsoft::UI::Windowing::TitleBarHeightOption::Tall);

Collapsed: 高度为0,也就是没有标题栏
this->ExtendsContentIntoTitleBar(true);
this->AppWindow().TitleBar().PreferredHeightOption(
Microsoft::UI::Windowing::TitleBarHeightOption::Collapsed);

819

被折叠的 条评论
为什么被折叠?



