【发布时间】:2022-07-19 21:37:39
【问题描述】:
为什么 SystemOverlayRightInset 是 0 ?在右侧,有字幕按钮(最小化,最大化,关闭)。但它返回0。
我的代码:
public MainPage()
{
this.InitializeComponent();
CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
coreTitleBar.ExtendViewIntoTitleBar = true;
double right = coreTitleBar.SystemOverlayRightInset;
}
我需要 CustomTitleBar ,所以我设置 (coreTitleBar.ExtendViewIntoTitleBar = true) 。基于系统保留的 SystemOverlyRightInset ,我需要在我的自定义区域中放置按钮。但是这里的 SystemOverlayRightInset 值是 0 ?为什么?
【问题讨论】:
-
与元素的FlowDirection有关
-
这里 SystemOverlayLeftInset 和 SystemOverlayRightInset 都为零。为什么?
-
我用官方代码样例测试过,SystemOverlayRightInset 不为零,可以分享一个minimal reproducible example给我们吗?
-
我的完整代码drive.google.com/drive/folders/…。我没有写太多代码。只是我尝试设置 ExtendViewIntoTitleBar = true 然后尝试获取 RightInset !但它为零?
-
我检查了你的代码,你只是将ExtendViewIntoTitleBar设置为true,但你没有设置标题栏内容。